• Resolved ctrlaltdelete

    (@ctrlaltdelete)


    Hello i’m using this code:
    echo do_shortcode( '[related_posts_by_tax posts_per_page="8" caption="post_title" columns="3" format="thumbnails"]' );

    The problem is that when i click a thumbnail instead of going to the post it attempts to display a “lightbox” and fails. I don’t want this at all i ant them to be links only not a “gallery”.

    View post on imgur.com

    Then there’s all these Gallery classes i think they are causing it:

    <div id="rpbt-related-gallery-1" class="gallery related-gallery related-galleryid-29145 gallery-columns-3 gallery-size-thumbnail"><figure class="gallery-item">
    <div class="gallery-icon portrait">

    View post on imgur.com

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

    (@keesiemeijer)

    Hi ctrlaltdelete

    Yes, your theme or a plugin is using the gallery CSS selectors of the gallery to open them in a lightbox. You can change the class names with a filter, but it could mean you lose some styling for the gallery.

    Try adding this to your theme’s functions.php file

    
    add_filter( 'related_posts_by_taxonomy_gallery_item_class', 'rpbt_gallery_item_class' );
    
    function rpbt_gallery_item_class($class) {
        return 'rpbt-gallery-item';
    }
    

    btw:
    consider creating a child theme instead of editing your theme directly – if you upgrade the theme all your modifications will be lost. Or create a plugin with the code above.

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    Hello i am using a child theme.
    With that function they display one under the other (instead of side by side) but still show a lightbox when clicked.

    Is there a way for me to make my own html from scratch? I only need post titles, permalink and thumbnail url. I’d like to do the rest myself if possible.

    But i’m scared to lose the plugin cache which is a must else the query isn’t fast enough.

    Plugin Author keesiemeijer

    (@keesiemeijer)

    You could create a new template and format. Read more about it here
    https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/templates/#create-format

    How do you cache the related posts? With a cache plugin or with the plugin cache feature?

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    Perfect, that solves it. I can tweak to my needs now, no more light box.

    I use this for caching:
    add_filter( 'related_posts_by_taxonomy_cache', '__return_true' );

    Plugin Author keesiemeijer

    (@keesiemeijer)

    Oh good, the posts will still be cached if you create a new format. Btw. it also would be if you used plugins (like wp super cache) to cache your site.

    Let me know if you need help with the new format or template.

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    The format is solved i think.

    I got a slow query from the plugin that doesn’t go away even with caching enabled:

    time varies from 0.05~0.1

    get_crp_posts_id()

    SELECT DISTINCT wp_posts.ID 
    FROM wp_posts 
    WHERE 1=1 
    AND MATCH (post_title,post_content) AGAINST ('Shin Megami tensei if...') 
    AND wp_posts.post_date < '2018-10-25 19:51:51' 
    AND wp_posts.post_date >= '2015-10-26 19:51:51' 
    AND wp_posts.post_status = 'publish' 
    AND wp_posts.ID != 115618 
    AND wp_posts.post_type IN ('post') 
    LIMIT 0, 6

    I want to mention that my post_content is EMPTY i only use custom fields no content.
    I also don’t use the post type ‘post’ and dates aren’t a factor, all posts are equally relevant. I don’t understand what this query is doing but can i speed it up or get rid of it?

    Plugin Author keesiemeijer

    (@keesiemeijer)

    That’s not a query from this plugin.

    Thread Starter ctrlaltdelete

    (@ctrlaltdelete)

    Amazing, i see. It’s my previous related post plugin. Close this before i embarrass myself even more.

    Plugin Author keesiemeijer

    (@keesiemeijer)

    No worries. Glad you’ve got it solved ??

    And you shouldn’t be embarrassed to not know every query this plugin makes! It seems apparent you know what you are doing!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘format=”thumbnails” conflicting with something ?’ is closed to new replies.