Obtain the previous article: previous_post_link () and the next article: next_post_link () parameters: 1. The current article is under the same category. 2. If the title, link, and special image of the previous article are only parameters 1, there are official examples: {code ...} I wonder if there is any way...
Get previous article: previus_post_link (), get next article: next_post_link ()
Parameters:
1. Current articles under the same category
2. Title, link, and special image of the next article
If only parameter 1 is used, an official example is provided:
I wonder if there is any requirement for obtaining parameter 2.
The two thumbnail images are the special images of the previous and next articles on WordPress. the_post_thumbnail (); the title and link below are called by the above Code, the special image is manually tuned. I want to automatically call the special image and link address of the previous or next article.
Reply content:
Get previous article: previus_post_link (), get next article: next_post_link ()
Parameters:
1. Current articles under the same category
2. Title, link, and special image of the next article
If only parameter 1 is used, an official example is provided:
I wonder if there is any requirement for obtaining parameter 2.
The two thumbnail images are the special images of the previous and next articles on WordPress. the_post_thumbnail (); the title and link below are called by the above Code, the special image is manually tuned. I want to automatically call the special image and link address of the previous or next article.
ID);?> ">
ID, '','');?> Previous: ID);?> ">
Post_title;?>
ID);?> ">
ID, '','');?> Previous: ID);?> ">
Post_title;?>
Good guys do it to the end.
Let's take a look at the changes.
function nav_link_with_thumb(){ $output = ''; $prev_post = get_previous_post(); if ($prev_post){ $output .= get_the_post_thumbnail($prev_post->ID, 'thumbnail'); $prev_post->filter='sample'; $output .= 'Previous Post: '.$prev_post->post_title.''; } $next_post = get_next_post(); if ($next_post){ $output .= get_the_post_thumbnail($next_post->ID, 'thumbnail'); $next_post->filter='sample'; $output .= 'Next post: '.$next_post->post_title.''; } echo $output;}
Can tabs be supported?