This topic has 24 replies, 4 voices, and was last updated 9 years by jliglesias.
-
Author
-
December 17, 2014 at 01:26 #39370PatagoniaParticipant
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
December 17, 2014 at 01:38 #39371sharmstrModeratorYou 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 01:40 #39372PatagoniaParticipantThanks for looking into this. Yes, it’s 2.3 now, so not sure if the problem was introduced with 2.2 or 2.3.
December 17, 2014 at 01:41 #39373sharmstrModeratorOh 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 02:01 #39374sharmstrModeratorHmmm. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 02:03 #39375sharmstrModeratorSorry. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 02:07 #39376sharmstrModeratorI 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 02:22 #39377sharmstrModeratorI 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 02:37 #39380sharmstrModeratorI 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 CODEfunction 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 03:45 #39385PatagoniaParticipantThank 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 🙂
December 17, 2014 at 03:50 #39386PatagoniaParticipantHmm, 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…
December 17, 2014 at 04:13 #39387PatagoniaParticipantStrangely enough this side-effect seems to have been temporarily (?). It’s ok now, maybe a cache-ing issue.
December 17, 2014 at 04:32 #39388PatagoniaParticipantScrap 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.
December 17, 2014 at 04:37 #39389sharmstrModeratorHmmm. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 04:49 #39390sharmstrModeratorCan 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 05:07 #39391PatagoniaParticipantThanks; 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.
December 17, 2014 at 05:37 #39392sharmstrModeratorSo 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 solutionThis 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.December 17, 2014 at 05:39 #39394sharmstrModeratorWait, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 05:49 #39395sharmstrModeratorRight 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 17, 2014 at 14:31 #39444sharmstrModerator@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 CODEfunction 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 18, 2014 at 16:02 #39574AbeKeymasterhello, 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.December 18, 2014 at 17:00 #39582AbeKeymasterhello 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 CODEif (! 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.December 18, 2014 at 17:32 #39586sharmstrModerator*high five*
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 12, 2015 at 19:44 #77332jliglesiasParticipantHi 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 CODEif ( 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.
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.