Anderhalv
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Fixing WordPress
In reply to: wp_link_pages(‘next_or_number=next’) doesn’t work on home.phpI’m trying to paginate pages within posts (for long posts).
In fact, I use it for both posts and pages. And wp_link_pages(‘next_or_number=number’) and wp_link_pages(‘next_or_number=next’) work fine in single.php and page.php. Only for home.php wp_link_pages(‘next_or_number=next’) doesn’t work, but wp_link_pages(‘next_or_number=number’) does.
I don’t get it 🙂
Forum: Fixing WordPress
In reply to: wp_link_pages(‘next_or_number=next’) doesn’t work on home.phpThanks for the suggestion, but next_or_number=text doesn’t work either.
Forum: Fixing WordPress
In reply to: Distinguish Posts and Pages in WordPress 2.5 search resultsHi — I’ve searched the support to find an answer to exactly the same question, but didn’t find it.
Browsing through the WP-code, I finally found a function called get_post_type(), which allowed me to do the trick! You can retrieve the post-type for a certain post/page, by use get_post_type($id) in the loop.
<?php if (have_posts()) : ?> while (have_posts()) : the_post(); $posttype = get_post_type($id); if ($posttype == 'post') { ?> Content on how you want to show POSTS. <?php } else { ?> Content on how you want to show PAGES. <?php } ?>
Viewing 3 replies - 1 through 3 (of 3 total)