• Hello everyone,

    My thumbnail images are not displaying on my pages with post lists. Yes I have the featured images set, and yes my homepage does have images with post lists, however; that is the only page that does have them.

    I would just like to have all of my pages to have a nice post lists with images.

    Here is what the php code looks like at this moment. If any of you think it might be a code related issue. I do not know if it is a code related issue because I don’t know how to code ??

    ANY HELP WOULD BE VERY APPRECIATED! ??

    /**
    * Post thumbnail
    */
    function zillah_post_thumbnail() {
    $post_format = get_post_format();
    if ( has_post_thumbnail() ) {
    echo ‘<div class=”post-thumbnail-wrap”>’;
    echo ‘‘;
    the_post_thumbnail();
    echo ‘
    ‘;
    echo ‘</div>’;
    } else {
    $post_image_link = zillah_catch_that_image();
    $zillah_image_as_thumbnail = get_theme_mod( ‘zillah_image_as_thumbnail’, false );
    if ( $post_image_link && $zillah_image_as_thumbnail ) {
    echo ‘<div class=”post-thumbnail-wrap”>’;
    echo ‘‘;
    echo ‘' . esc_attr( get_the_title() ) . '‘;
    echo ‘
    ‘;
    echo ‘</div>’;
    }
    }
    }

    /**
    * Post image
    */
    function zillah_post_image() {
    if ( has_post_thumbnail() ) {
    echo ‘<div class=”post-thumbnail-wrap”>‘;
    the_post_thumbnail();
    echo ‘
    </div>’;
    } else {
    $post_image_link = zillah_catch_that_image();
    if ( $post_image_link ) {
    echo ‘<div class=”post-thumbnail-wrap”>‘;
    echo ‘' . esc_attr( get_the_title() ) . '‘;
    echo ‘
    </div>’;
    }
    }
    }

    I also don’t know if this has anything to do with this issue or not?

    /**
    * Exclude posts from the slider on the main page loop
    */
    function zillah_exclude_single_posts_home( $query ) {

    if ( $query->is_home() && $query->is_main_query() ) {
    $zillah_home_slider_show = get_theme_mod( ‘zillah_home_slider_show’, false );
    if ( $zillah_home_slider_show ) {
    $zillah_home_slider_category = get_theme_mod( ‘zillah_home_slider_category’, 0 );
    $args = array(
    ‘posts_per_page’ => 6,
    ‘post_type’ => ‘post’,
    ‘category’ => $zillah_home_slider_category !== 0 ? $zillah_home_slider_category : ”,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘_thumbnail_id’,
    ),
    ),
    );
    $slider_posts = get_posts( $args );
    $array_post = array();
    if ( ! empty( $slider_posts ) ) {
    foreach ( $slider_posts as $post ) {
    if ( ! empty( $post->ID ) ) {
    array_push( $array_post, $post->ID );
    }
    }
    }
    $query->set( ‘post__not_in’, $array_post );
    }
    }

    }
    add_action( ‘pre_get_posts’, ‘zillah_exclude_single_posts_home’ );

    add_action( ‘wp_head’,’zillah_php_style’ );

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • put this code in code file,this code help for list the all post featured image
    <?php
    global $post;
    $args = array( ‘posts_per_page’ => -1 );
    $myposts = get_posts( $args );
    foreach ( $myposts as $post ) :
    setup_postdata( $post ); ?>
    <?php the_post_thumbnail(”); ?>
    “><?php the_title(); ?>
    <?php the_content(); ?>
    <?php endforeach;
    wp_reset_postdata(); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Image Thumbnails Not Showing Up On Pages With Post Lists’ is closed to new replies.