Displaying all pages which comes under a category id

Use this code , <?php $args = array( ‘posts_per_page’ => -1, ‘offset’ => 1, ‘category’ => 4, ‘numberposts’ => -1 ); $pages = get_pages($args); $i = 1; foreach ($pages as $page) { if ($i == 1) { ?> <div class=”carousel-item active” style=”background-image: url(‘<?php echo get_bloginfo(‘template_url’); ?>/img/intro-carousel/1.jpg’);”> <div class=”carousel-container”> <div class=”carousel-content”> <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($page->ID), ‘optional-size’); … Read more

How to create page with post content in it?

You might get away with shortcodes: add_shortcode(‘title’, function ($atts, $content = null) { $atts = shortcode_atts([ ‘id’ => null, ], $atts); $title=””; if (!empty($atts[‘id’])) { $title = get_the_title($atts[‘id’]); } return $title; }); add_shortcode(‘content’, function ($atts, $content = null) { $atts = shortcode_atts([ ‘id’ => null, ], $atts); $content=””; if (!empty($atts[‘id’])) { $post = get_post($atts[‘id’]); // … Read more