This topic has 24 replies, 4 voices, and was last updated 8 years by jliglesias.

  • Author

    Tagged: , , ,

  • #39370
     Patagonia
    Participant

    Hi there,

    I just updated KLEO to the latest version (from, I think 2.1.1 to 2.2). Since then my page tags don’t seem to be working anymore. Sorry, no live site, but here is all info:

    – My site contains hundreds of pages and very few blog posts, therefore I needed tags for pages
    – I use this plugin: https://wordpress.org/plugins/post-tags-and-categories-for-pages/

    It worked before, but not anymore since updating KLEO (I updated no other plugins):
    – When clicking on a post tag it works as expected: a page with the list of posts
    – when clicking on a page tag, I get a page of which the content area simply says “It seems we can’t find what you’re looking for. Perhaps searching can help.”, with a simple search box below. The rest of the page loads normally.

    I tried changing the tags slug, resaving the permalinks, emptying all caches etc etc but to no avail.

    I noticed a support thread on the plugin’s forum where was asked if the theme uses “pre_get_posts”filter, which might interfere. Is this so and has this been changed recently and is there a workaround? The tags for pages is extremely useful for all CMS applications.

    Thanks

    #39371
     sharmstr
    Moderator

    You should be at 2.3 for both Kleo and k-elements. Tags were introduced for Portfolio items, but not sure how that would effect pages. I’ll install that plugin and see if I have the same issue.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39372
     Patagonia
    Participant

    Thanks for looking into this. Yes, it’s 2.3 now, so not sure if the problem was introduced with 2.2 or 2.3.

    #39373
     sharmstr
    Moderator

    Oh and to answer your question about pre_get_posts. I thinks its only used to display featured posts. Always has been.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39374
     sharmstr
    Moderator

    Hmmm. I just installed it and it worked for categories, but not tags. So then I disabled Kleo and enabled the wordpress 2014 theme. Tags didnt work for 2014 theme either. Then I disabled K-elements and it still didnt work. So I think we’ve ruled out Kleo as the culprit. Maybe?

    Wordpress 4.0.1 was released last week. Maybe that caused it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39375
     sharmstr
    Moderator

    Sorry. I looked at the wrong date. 4.0.1 was released 3 weeks ago.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39376
     sharmstr
    Moderator

    I have a site still in beta that’s running kleo 2.2. I’ll test it there and report back.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39377
     sharmstr
    Moderator

    I think you’re right. Its a kleo issue. It worked on my 2.2 site until I updated kleo to 2.3. The site was already running k-elements 2.3. Site even works with other themes enabled.


    @abe
    – help. 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39380
     sharmstr
    Moderator

    I figured it out. As I said, they added tags to portfolios starting with 2.3. In that add, they have a new function that filters the queries and are only specifying posts, portfolios and products. You’ll have edit core code to fix this, but I’m sure @abe will come up with another fix for the next update (sorry if I’m putting you on the spot abe)

    Anyhow, open up /kleo/lib/post-types.php. All the way at the bottom you’ll see kleo_archive_add_custom_types. On the line that has ‘post’, ‘portfolio’, ‘product’ add ,’page’ at the end so it looks like this

    COPY CODE
    
    function kleo_archive_add_custom_types( $query ) {
        if(is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
            $query->set( 'post_type', array(
                'post', 'portfolio', 'product','page'
            ));
            return $query;
        }
    }
    add_filter( 'pre_get_posts', 'kleo_archive_add_custom_types' );
    
    

    That should fix it. Let me know.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39385
     Patagonia
    Participant

    Thank you very much, Sharmstr, that fixed it for now. Please make a reminder/trac or something for Abe. so I don’t have to change it after every update 🙂

    #39386
     Patagonia
    Participant

    Hmm, it does have a strange unwanted side effect: in both the latest posts widget (Kleo Latest post, with “post type =post” defined), as well as in the bb-press latest post widget, the latest pages now appear instead of blog posts and forum posts…

    #39387
     Patagonia
    Participant

    Strangely enough this side-effect seems to have been temporarily (?). It’s ok now, maybe a cache-ing issue.

    #39388
     Patagonia
    Participant

    Scrap the previous post: the side effect does exist as described, the correct version was still cached, but clearing the caches creates the problem on all pages.

    #39389
     sharmstr
    Moderator

    Hmmm. I see that. Let me see what I can do about that. But might have to have abe sort it out.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39390
     sharmstr
    Moderator

    Can you try deleting and readding the (Kleo) Recent posts = Posts and (Kleo) Recent posts = Topics? I did that on my site and it seems to have fixed the issue with that widget.

    However, it hasnt fixed it for (bbPress) Recent Topics.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39391
     Patagonia
    Participant

    Thanks; Yes, that seems to work with the KLEO widget (only), though the BBpress widget is more useful as it does not show the date for the topics.

    #39392
     sharmstr
    Moderator

    So does the kleo widget. See attached.

    Also you can see that it does by looking at the code in /kleo/lib/widgets/recent_post.php. 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #39394
     sharmstr
    Moderator

    Wait, you said “does NOT”. Well, we can get rid of that. Hold tight.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39395
     sharmstr
    Moderator

    Right click on the Topics widget to get the correct id, then use it like this (change 6 to your id)

    COPY CODE
    
    #kleo_recent_posts-6 .news-time {
    display: none;
    }
    

    Anyhow, this is all temporary until Abe can come up with a better solution. I’ve assigned this topic to him, so he’ll see it.

    I’ve also noticed that if you move away from widgets, go back in and save, they start listing all the pages again. So dont do that for now.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39444
     sharmstr
    Moderator

    @patagonia, can you try this instead? I think adding the $query->is_main_query solves the problem and you’ll be able to use bbpress topics widget again.

    COPY CODE
    
    function kleo_archive_add_custom_types( $query ) {
        if(is_tag() && empty( $query->query_vars['suppress_filters'] ) && $query->is_main_query() ) {
            $query->set( 'post_type', array(
                'post', 'portfolio', 'product','page'
            ));
            return $query;
        }
    }
    
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39574
     Abe
    Keymaster

    hello, thank you for your intervention @sharmstr. I am looking for a way so kleo_archive_add_custom_types function will just append the portfolio type to that query.. keep you posted 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #39582
     Abe
    Keymaster

    hello guys and gals, here is the final code since I took a look at that plugin and the author did it just like that

    COPY CODE
    
    if (! function_exists( 'kleo_archive_add_custom_types' ) ) {
        function kleo_archive_add_custom_types( $query )
        {
            if (is_tag() && empty($query->query_vars['suppress_filters'])) {
                /*$query->set( 'post_type', array('post', 'portfolio', 'product'));*/
                $query->set('post_type', 'any');
                return $query;
            }
        }
    }
    add_filter( 'pre_get_posts', 'kleo_archive_add_custom_types' );
    

    It will be included in the next theme update so you don’t have to worry about it on theme update

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #39586
     sharmstr
    Moderator

    *high five*

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39644
     Patagonia
    Participant

    Thank you, Abe & Sharmstr!

    #77332
     jliglesias
    Participant

    Hi there,

    Abe, this code doesn’t work right with the bbpress plugin and posts tags, i.e. : the widget for the list of forums and the recent posts doesn’t display correctly. Maybe it is because the post_type filter is ‘any’, but I don’t know!.

    I have now changed your code, like this:

    COPY CODE
    if ( is_tag() && empty($query->query_vars['suppress_filters']) && $query->is_main_query() ) {
                /*$query->set( 'post_type', array('post', 'portfolio', 'product'));*/
                $query->set('post_type', 'any');
                return $query;
    }

    It’s working fine for me!, is this correct?

    Thank you, everyone.

Viewing 25 posts - 1 through 25 (of 25 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?