Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mattkaner

    (@mattkaner)

    Just to clarify: the lightbox function works fine elsewhere (where it is not called up via an included page).

    Forum: Plugins
    In reply to: Post enumeration

    I seem to have found a way around this with get_post_custom_values('incr_number');

    However, I’m still wondering, is there a way to reverse the enumeration i.e. call the *newest* post 1, the next 2 etc.?

    Forum: Plugins
    In reply to: Post enumeration

    Hi.

    I’m in a similar situation. I’m using custom post-types with WordPress 3.01. Using moarghorgh’s solution I’ve changed the code that goes into functions.php and have managed to get the custom field working; the numbers adjust themselves automatically when I add/delete a new post.

    However, I can’t for the life of me get the line of code below to work; and therefore can’t actually display the numbers!

    <?php echo get_post_meta($post->ID,'incr_number',true); ?>

    The custom post type is named ‘gallery’.

    Hi there – I noticed you published a solution to this – although I’ve tried implementing it and it seems to cause problems with pagination for me.

    I’ve used the usual query_posts pagination fix and adapted your code like this:

    <?php
    $authors = $wpdb->get_results("SELECT ID
    FROM $wpdb->users
    WHERE EXISTS
    (SELECT post_author
    FROM $wpdb->posts
    WHERE $wpdb->users.ID = $wpdb->posts.post_author
    AND $wpdb->posts.post_status = 'publish'
    AND $wpdb->posts.post_type = 'blog')
    ORDER BY display_name");
    
    foreach($authors as $author) {
    	$curauth = get_userdata(intval($author->ID));
    ?>
    
    <h2>Author Profile for <span style="color:#560000;"><?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?></span></h2>
    <p><?php echo $curauth->user_description; ?></p>
    <div style="height:8px;"></div>
    <h2 style="font-size:15pt;"><?php echo $curauth->first_name; ?>’s Posts</h2>
        <!-- Posts Loop -->
    <?php if (have_posts()) : ?>
         <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("post_type=any&paged=$paged&author=$author->ID&orderby=date&showposts=2"); while (have_posts()) : the_post(); ?>
    
    <div style="padding-left:20px; padding-right:20px;">
    <div id="smallerheaders"><h2><?php the_title(); ?></h2></div>
    <?php the_content(__('(Click for more...)')); ?></div>
    <div id="nextentry"></div>
    <?php endwhile; else: ?>
    <p><?php _e('No posts by this author.'); ?></p>
    <?php endif; ?>
    <?php } ?>
    
    <div class="clear"></div>
    <div style="width:400px; padding-left:20px; padding-bottom:20px; margin-top:1px; overflow:hidden; font-size:10pt; font-family:Georgia;"><?php wp_pagenavi(); ?></div>
    <?php wp_reset_query(); ?>
      </div>
      </div>
    
    <?php get_footer(); ?>

    But it still seems to cause me trouble (the second page and any after that just create a 404).

    Found the solution

    It’s the query_posts line I was using that caused it.

    Solution here if anyone else needs it:

    https://stylizedweb.com/2008/08/13/query_posts-pagination-problem/

    Hi there,

    Has anyone found a definitive solution to this? I’m using wp-pagenavi, and have tried to implement nathanrice’s solution but it doesn’t seem to work…

    Just to clarify – I’m using home.php to return a specific category of posts here

    but at the moment /?paged=2 (i’m not using permalinks for now) just doesn’t do anything, returning the same results as before…

Viewing 6 replies - 1 through 6 (of 6 total)