• On the following page
    https://www.shamelessreading.com/romance-ebook-erotica-blog/popular-genres/historical-romance/

    I’ve been tweaking a script that grabs the info for all posts with the “historical” tag, pops out the thumbs w/ links to the appropriate posts, but something in the code isn’t closed or something, because when it gets to the bottom of the page, all the closing info goes to the wrong post (as in, it’s giving me the tags and link to edit for a completely different post. ??

    <?php $my_query = new WP_Query('tag="historical"&showposts=100');
    while ($my_query->have_posts()) : $my_query->the_post(); {?>
    <?php $values = get_post_custom_values("Thumb");
    if ($values[0]){?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php echo get_option('home'); ?>/wp-content/uploads/<?php echo $values[0]?>" alt="" class="coverthumb" /></a><?php }} ?>
    <?php endwhile; ?>

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter manloveebooks

    (@manloveebooks)

    ETA: It seems it’s using the tag/edit/etc info for the last of the pages pulled. I guess I’ve got to figure out to have it forget that it just grabbed all the historical pages and go back to the info from the original page in question.

    Thread Starter manloveebooks

    (@manloveebooks)

    EATA: Okay, with some poking around, I know I’ve got to reset the original query w/

    <?php if (have_posts()) : while (have_posts()) : the_post();
    	update_post_caches($posts); ?>

    But I’m now trying to figure out if it should be in the page’s query or on page.php.

    Thread Starter manloveebooks

    (@manloveebooks)

    ?? Current attempt, still not working. ??

    <?php $my_query = new wp_query('tag="historical"&showposts=100');
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <?php $values = get_post_custom_values("Thumb");
    if ($values[0])
    {?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php echo get_option('home'); ?>/wp-content/uploads/<?php echo $values[0]?>" alt="" class="coverthumb" /></a><?php
    } ?>
    <?php
    wp_reset_query();
    endwhile;
     ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘edit etc links go to wrong post on thumb page’ is closed to new replies.