Forum Replies Created
-
AuthorPosts
-
kokosan
ParticipantOne problem is that filter by this taxonomy is not working. I asign two posts to this taxonomy and add it to filter. When I click this filter, it show all posts, in stead of the twe posts that has this taxonomy . But, I see the two posts if use Uncategorized category filter.
kokosan
ParticipantI can get it done now, somehting like this
add_filter( 'asp_results', 'asp_show_element_taxonomy', 10, 1 ); function asp_show_element_taxonomy( $results ) { foreach ($results as $k=>&$r) { $extext = get_post_meta($r->id, 'example_text', true); if (has_term('', 'exampletaxonomies',$r->id)) $r->content = "<span>$extext</span><span>show this div</span>"; } return $results; }Very awesome plugin, actually no need to create a separated custom post type to achieve this like I think before.
kokosan
ParticipantHi, sorry for not being clear. The code below displays the div on every post. I want to display the div below only if a post has custom taxonomy “topic1”. In this case, use
$r->content_type == 'pagepost' or 'term'?<?php
if ($r->content_type == ‘pagepost’ ) {
?>
<div>show this div on the result if posts are in taxonomy “topic1″</div>
<?php
}
?>February 28, 2023 at 11:33 am in reply to: show some length of text (not full content) around the highlighted word #41573kokosan
ParticipantIndeed! it’s custom code, sorry. Now I adjust some design of concept, so need to show less result.
February 27, 2023 at 3:33 pm in reply to: show some length of text (not full content) around the highlighted word #41561kokosan
ParticipantI’ve tried that but nothing’s changed. It still show full content. https://drive.google.com/file/d/1kvN2-KnWwsZguA0Zb00vboIFTv-ofnz8/view?usp=sharing
I’ve just uploaded my site to a new hosting server and the site almost finishes . Let me know if you need to login to have a look.
kokosan
ParticipantI read again and now understnd “add a mouseut event handler to remove the “tooltipped” and “tooltipped-s” classes ” Thanks for pointing out the code.
kokosan
ParticipantCan you recommend which line of code to remove?
kokosan
ParticipantAt my end it works in a page (In the page tooltip doesn’t reapear on mouse hover.) but not work in the result. https://drive.google.com/file/d/1O8AHZ36AKLojoOKfwijxSHzK8aFasAEc/view?usp=sharing
kokosan
ParticipantOk, I will go with cstom post type then.
kokosan
ParticipantOk, now I can apply the code to the specific search instance, thank you.
1) I add a the custom field value to one post that has category Book 1 and one post to catgegory Book2. But it show up only the post that’s in category Book1 and load more show nothing. But when I unckeck ctaegory Book 1 in the filter, the post that’s in category Book2 then shows up.
2) Another thing is Load more button that shows many counts and when I click it show nothing. How to load only posts that have this custom field value, the post category, and the post tag only? Load 10 posts per time.
And here is a video to reproduce the issue https://drive.google.com/file/d/1Ywl8mboG0PeX2s_zK7kYdXEuekqo_hZq/view?usp=sharing
kokosan
ParticipantI have 2 search concepts. One search concept still uses default title while the other doesn’t, but use custom field. The code applies globally to both search concepts. So, it’s not possible to apply the code to a specific search instance (the one that uses custom field) without affecting the other (the one that uses default title)?
kokosan
ParticipantI’ve tried the code, ok,it removes the title that doesn’t contain the custom field. However, it doesn’t display properly and having an issue with load more (globally). I thnk I will use custom post type to acheve this. Thank you.
January 23, 2023 at 4:16 pm in reply to: Same result behavour (no highlighted word but show up) #41060kokosan
ParticipantI see.
January 23, 2023 at 1:24 pm in reply to: Same result behavour (no highlighted word but show up) #41049kokosan
ParticipantSo, it’s hidden by default, right? In the video I didn’t see it. https://drive.google.com/file/d/12hFgnIUojEy8zsTqomSOAE9aFIZrsAGm/view?usp=sharing
January 23, 2023 at 1:08 pm in reply to: Same result behavour (no highlighted word but show up) #41048kokosan
ParticipantYour eyes are better scanning than my mine regarding this : D. I didn’t even notice that it’s in brackets! Work now, thank you!
-
AuthorPosts