get_adjacent_post_rel_link [ WordPress Function ]
get_adjacent_post_rel_link ( $title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: adjacent_posts_rel_link, get_parent_post_rel_link, adjacent_post_link, get_adjacent_post, parent_post_rel_link
Get adjacent post relational link.
Can either be next or previous post relational link.
Source
<?php
function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) {
if ( $previous && is_attachment() && is_object( $GLOBALS['post'] ) )
$post = & get_post($GLOBALS['post']->post_parent);
else
$post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);
if ( empty($post) )
return;
if ( empty($post->post_title) )
$post->post_title = $previous ? __('Previous Post') : __('Next Post');
$date = mysql2date(get_option('date_format'), $post->post_date);
$title = str_replace('%title', $post->post_title, $title);
$title = str_replace('%date', $date, $title);
$title = apply_filters('the_title', $title, $post->ID);
$link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='";
$link .= esc_attr( $title );
$link .= "' href='" . get_permalink($post) . "' />\n";
$adjacent = $previous ? 'previous' : 'next';
return apply_filters( "{$adjacent}_post_rel_link", $link );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get adjacent post rel link « WordPress Codex
Description. Get adjacent post relational link. Can either be next or previous post relational link. Usage. <?php get_adjacent_post_rel_link( $title, $in_same_cat, ...
codex.wordpress.org - WordPress › Support » The curse of get_adjacent_post_rel_link
The curse of get_adjacent_post_rel_link (2 posts). cleoni. Member Posted 1 month ago #. Hello, I found out that this function: get_adjacent_post_rel_link ...
wordpress.org - php - How do I use get_adjacent_post_rel_link() in AJAX content ...
Apr 24, 2012 ... pictures of interface. I've created a jquery script to AJAX load content. This content consists of post made from a custom-post-type. For reference ...
stackoverflow.com - get_adjacent_post_rel_link() WordPress function reference ...
Get adjacent post relational link. Can either be next or previous post relational link. Signature. get_adjacent_post_rel_link( $title = '%title', $in_same_cat = false, ...
queryposts.com