• Anonymous User 13882600

    (@anonymized-13882600)


    Hello,

    I’ve been using your plugin for a while an I love it.

    The only thing that bugs me is the 3 column display on the phone as well as on desktop.
    I ran into some thread where another user explains how to display 2 columns on mobile devices but I can’t find it now.
    Could you, please, explain?

    I have this code in my child theme’s function.php file:

    
    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_1 = '[related_posts_by_tax posts_per_page="6" link_caption="true" title="Related X:" taxonomies="post_tag" format="thumbnails" image_size="medium" orderby="post_date" exclude_terms="5954,21703,16823,16467"]';
    			
                $shortcode_2 = '[related_posts_by_tax posts_per_page="6" link_caption="true" title="Related Y:" taxonomies="(custom_taxonomy)" format="thumbnails" image_size="medium" orderby="post_date"]';
    			
                $shortcode_3 = '[related_posts_by_tax posts_per_page="6" link_caption="true" include_children="true" title="Related Z:" taxonomies="category" format="thumbnails" image_size="medium" exclude_terms="10530,18894" orderby="post_date"]';
    			
                // add the shortcode after the content
                $content = $content . $shortcode_1 . $shortcode_2 . $shortcode_3;
            }
        }
     
        return $content;
    }
    add_filter( 'related_posts_by_taxonomy_id_query', '__return_true' );
    
  • The topic ‘2 columns on mobile’ is closed to new replies.