adjacent_post_link [ WordPress Function ]
adjacent_post_link ( $format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true )
| Parameters: |
|
| Defined at: |
|
Benzer Fonksiyonlar: adjacent_posts_rel_link, get_adjacent_post_rel_link, adjacent_image_link, next_post_link, edit_post_link
Display adjacent post link.
Can be either next post link or previous.
Source
<?php
function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) {
if ( $previous && is_attachment() )
$post = & get_post($GLOBALS['post']->post_parent);
else
$post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);
if ( !$post )
return;
$title = $post->post_title;
if ( empty($post->post_title) )
$title = $previous ? __('Previous Post') : __('Next Post');
$title = apply_filters('the_title', $title, $post->ID);
$date = mysql2date(get_option('date_format'), $post->post_date);
$rel = $previous ? 'prev' : 'next';
$string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
$link = str_replace('%title', $title, $link);
$link = str_replace('%date', $date, $link);
$link = $string . $link . '</a>';
$format = str_replace('%link', $link, $format);
$adjacent = $previous ? 'previous' : 'next';
echo apply_filters( "{$adjacent}_post_link", $format, $link );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- how to customize wordpress internal functions, like - Stack Overflow
how to customize wordpress internal functions, like adjacent_post_link(). up vote 0 down vote favorite. share [g+] share [fb] share [tw]. I need to ...
stackoverflow.com - adjacent_post_link | A HitchHackers guide through WordPress
Feb 11, 2011 ... Source code. function adjacent_post_link($format, $link, $in_same_cat = false, $ excluded_categories = '', $previous = true) { if ( $previous ...
hitchhackerguide.com - PHPXRef 0.7 : WordPress : Function Reference: adjacent_post_link()
Function and Method Cross Reference. adjacent_post_link(). Defined at: /wp- includes/link-template.php -> line 1327. Referenced 2 times: ...
phpxref.ftwr.co.uk - #14440 (Override filter for adjacent_post_link()) – WordPress Trac
I'm working on a plugin that needs to integrate with as many themes as possible. It's basically a plugin for creating portfolios of images. It uses a custom ...
core.trac.wordpress.org