Links & Image
-
How to have links & thumbnail/images based on tags appear on every single pages related?
It seem using default code only show links and if add thumbnail it will just show image
How to show post with & without images together related tags?
Thanks
-
Hi DPWP
Can you explain a little bit more?
Do you want to also display related posts that don’t have a post thumbnail? If so, see this: https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/recipes/#image-fallback
If posts have mix of with and without image
how to show all together links and thumbnail/image
I have just added the default show post in each post + taxonomies = post_tags – it work fine
It won’t work if i want to show links + image post together just either 1
It’s either links or images. You can’t mix the two. You can create a fallback image for posts that don’t have images.
Did you see this? https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/recipes/#image-fallback
Are you using the widget or the shortcode?
Adding Related Posts After the Post Content –
‘[related_posts_by_tax posts_per_page=”4 taxonomies=”post_tag”]’
If using fallback image for non thumbnail post – will it show like links with below short content details/excerpt
add_filter( 'the_content', 'add_related_posts_after_post_content' ); function add_related_posts_after_post_content( $content ) { //check if it's a single post page. if ( is_single() ) { // check if we're inside the main loop if ( in_the_loop() && is_main_query() ) { // add your own attributes here (between the brackets [ ... ]) $shortcode = '[related_posts_by_tax posts_per_page="4"]'; // add the shortcode after the content $content = $content . $shortcode; } } return $content;How to change the default links without underline?
links and post with excerpt all title have underline on links how to fix it? where is the code/function
Fallback images are shown like this
I’m sorry but you can’t mix the two formats. Choose links or choose the fallback image method to have all posts displayed.
The underline is added by default in all browsers. You can remove it with css.
https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/post-thumbnails/#stylingCan you share a link to a page with related posts on it.
I am using default code provided by you – Adding Related Posts After the Post Content + shortcode [related_posts_by_tax posts_per_page=”4 taxonomies=”post_tag”]
What code/filter need to added in your default script to have the image fallback?
If i add code format=”thumbnails”
The post that without images won’t show
I am just testing on on localhost not done online sorry
add this ? [related_posts_by_tax format=”images”]
+
// Adds the ‘Post Images’ format to the widget
// after the plugin’s defaults are set (priority 11).
add_action( ‘wp_loaded’, ‘rpbt_add_post_images_format_widget’, 11 );function rpbt_add_post_images_format_widget() {
if ( !class_exists( ‘Related_Posts_By_Taxonomy_Defaults’ ) ) {
return;
}$defaults = Related_Posts_By_Taxonomy_Defaults::get_instance();
// Add the new format.
$defaults->formats[‘images’] = __( ‘Post Images’ );
}I am not using widget instead function..
If you added the full code found here: https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/recipes/#image-fallback
You can use the “images” format in the code you already use:
$shortcode = '[related_posts_by_tax posts_per_page="4" format="images"]';Upload a fallback image in wp-admin > media > Add New
Change this in the fallback code:// $image = wp_get_attachment_image( 123, $args['size'], false, $attr['describedby'] );to this
$image = wp_get_attachment_image( 123, $args['size'], false, $attr['describedby'] );And change
123to the ID of your uploaded fallback image.The fallback image appear not right if added the code
$shortcode = '[related_posts_by_tax posts_per_page="4" format="images" taxonomies="post_tag"]';Images Links – Blank Links – Images Link
1-2 are the sameAbout the widget – post type – selected only products – not appear any items?
The topic ‘Links & Image’ is closed to new replies.