open
16.07.2022.

Include page example

Last update: 16.09.2022.

How to insert a php file or page content into another content.

<?php include 'slider.php';?>
// or by id
<?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query();$wp_query->query('post_type=page&page_id=13');?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?><?php the_content('more') ?>
<?php endwhile; ?>
<?php $wp_query = null; $wp_query = $temp;?>
Copy to Clipboard

Related posts

Got a question? Is something not working? Write and I'll answer!

Leave a Reply

Your email address will not be published. Required fields are marked *