Forums

query workin in home and not in single page... (1 post)

  1. kharlo
    Member
    Posted 2 years ago #

    hi,
    I don't know why, but this code i s working in home.php (it gives me the 6 elements in the output) but not in index.php (here I get only the first element)...

    The code takes the defined posts and gives me the title, the permalink and a custom field named "intro".

    <?php
    $thePostIdArray = array("82","84","86","88","90","92");
    $limit = 6
    if (have_posts()) :
    while (have_posts()) : the_post(); $counter++;
    if ( $counter < $limit + 1 ):
    $post_id = $thePostIdArray[$counter-1];
    $queried_post = get_post($post_id);
    echo $queried_post->post_title;
    echo get_post_meta($post_id, 'intro', true);
    echo get_permalink($post_id);
    endif;
    endwhile;
    endif;
    ?>

    Any help?
    Thank you!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags