• Hi there – I’m really new to coding for WordPress and I’m a bit stuck. I’ve created a custom template page for one of my pages; the header appears and the posts display as I want them to, but then there is nothing else. I can write whatever I want below and it won’t show – I also have the get sidebar and footer at the bottom and again neither of them are showing up. Can anyone see anything obvious that might be causing the problem? The header, sidebar and footer show up on all other pages. Below is the code I’ve used:

    <?php
    /**
    * Template Name: Website Custom Page
    */

    get_header(); ?>

    <div id=”primary” class=”content-area”>
    <main id=”main” class=”site-main”>
    <div id=”main-banner”>
    /images/banner.jpg” alt=”jamesdpdrury Examples of Work”>
    <div class=”main-banner-text”><?php wp_title(”, true,”); ?></div>
    </div>
    <div class=”wrapper”>
    <div class=”other-websites”>
    <p class=”section-title”>Latest Designs</p>
    <?php
    $paged = (get_query_var( ‘paged’ )) ? get_query_var( ‘paged’ ) : 1;
    $args = array(
    ‘post_type’ => ‘post’,
    ‘post_status’ => ‘publish’,
    ‘category_name’ => ‘websites’,
    ‘posts_per_page’ => 4,
    ‘paged’ => $paged,
    );
    $arr_posts = new WP_Query( $args );

    if ( $arr_posts->have_posts() ) :

    while ( $arr_posts->have_posts() ) :
    $arr_posts->the_post();
    ?>
    <div class=”post-block”>
    <article>
    ID, ‘link’, true); ?>”>
    <ul class=”textWithBlurredBg”>
    <?php
    if ( has_post_thumbnail() ) :
    the_post_thumbnail();
    endif;
    ?>
    <h2><?php the_title(); ?></h2>


    </article>
    </div>
    <?php
    endwhile;
    wp_pagenavi(
    array(
    ‘query’ => $arr_posts,
    )
    );
    endif;
    ?>
    </div>
    </div>
    </main><!– .site-main –>
    </div><!– .content-area –>

    <?php
    get_sidebar();
    get_footer();

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could have an error somewhere, so the bottom of the page isn’t output. Try using the WP_DEBUG define.
    You also might want to read https://developer.wordpress.org/reference/functions/wp_reset_postdata/

    Hi Joy
    Good day.
    I have a problem with my featured image.
    I am stuck in the ABOUT & CONTACT US pages. The featured images not showing in the web page, only grey areas. What went wrong?? The BLOG page is working fine, with a featured image.
    Under Theme Option, the settings are as follow:-
    1.Front Page section 1 content – BLOG
    2.Front Page section 2 content – ABOUT
    3.Front Page section 3 content – CONTACT US
    When I am at the “Pages”,( in the admin area, ie. About & Contact Us), the featured images for both the About & Contact Us can be seen.

    So, based on the above settings, can you advise how I can resolve the issue?
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nothing is showing after posts’ is closed to new replies.