Viewing 15 replies - 1 through 15 (of 35 total)
  • Plugin Author keesiemeijer

    (@keesiemeijer)

    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

    Thread Starter John

    (@dpinc)

    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

    Plugin Author keesiemeijer

    (@keesiemeijer)

    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?

    Thread Starter John

    (@dpinc)

    Adding Related Posts After the Post Content –

    ‘[related_posts_by_tax posts_per_page=”4 taxonomies=”post_tag”]’

    Thread Starter John

    (@dpinc)

    If using fallback image for non thumbnail post – will it show like links with below short content details/excerpt

    Thread Starter John

    (@dpinc)

    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;
    Thread Starter John

    (@dpinc)

    How to change the default links without underline?

    Thread Starter John

    (@dpinc)

    links and post with excerpt all title have underline on links how to fix it? where is the code/function

    Plugin Author keesiemeijer

    (@keesiemeijer)

    Fallback images are shown like this

    View post on imgur.com

    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/#styling

    Can you share a link to a page with related posts on it.

    Thread Starter John

    (@dpinc)

    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

    Thread Starter John

    (@dpinc)

    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’ );
    }

    Thread Starter John

    (@dpinc)

    I am not using widget instead function..

    Plugin Author keesiemeijer

    (@keesiemeijer)

    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 123 to the ID of your uploaded fallback image.

    Thread Starter John

    (@dpinc)

    The fallback image appear not right if added the code

    $shortcode = '[related_posts_by_tax posts_per_page="4" format="images" taxonomies="post_tag"]';

    Thread Starter John

    (@dpinc)

    Images Links – Blank Links – Images Link
    1-2 are the same

    About the widget – post type – selected only products – not appear any items?

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Links & Image’ is closed to new replies.