-
AuthorPosts
-
June 8, 2018 at 10:21 pm #970196
Hi! what a great theme update. Excellent work. Now that we can designate a page as a Footer Template, I’d like to exclude it from the ajax search in the header. Because when it comes up, visitors get a “Page not Found” result. Perhaps I’m missing something?
Can this be done? It seems like something important to add to the theme’s features.
Thanks So much!
June 10, 2018 at 6:48 pm #970835Hey doug123,
Can we please see it live so we can try understand what is going on please and how we can help?
Best regards,
BasilisJune 10, 2018 at 11:48 pm #970898Thanks for your reply!
Sure thing. Please see private content. I love the new Footer Template option. But it should never appear in search results.
June 11, 2018 at 1:44 pm #971171Hi doug123,
Here are some threads to consider:
https://kriesi.at/support/topic/exclude-pages-from-search/
If you need further assistance please let us know.
Best regards,
VictoriaJune 11, 2018 at 8:50 pm #971383Hi – thanks so much for your response!
I don’t think I’m explaining the problem well! Or maybe there is a good reason I’m not aware of, and am happy to be corrected.
Many Enfold users who use your new Footer Template function will have this very funky 404 result using Enfold’s Search. I’m sure it’s not your intention.
To illustrate, please perform these steps:
Go to the site.
In the search, located in the menu, enter “Copyright”.
You’ll see “Footer Template” first in the list of results. (“Copyright” is of course in the footer)
Click on Footer Template link in the search results list.
You get a Page Not Found result.Enfold’s Footer Template should be invisible. It’s a major new function but has this flaw and displays in Enfold’s search results.
Your definition of the Footer Template: “This page is currently selected to be displayed as footer. (Set in Enfold » Footer). Therefore it can not be accessed directly by the general public in your front end.”
However, here it is, showing up as a search result. It also creates a 404 situation.
June 13, 2018 at 5:13 am #972035Hi,
Thank you for using Enfold.
Use this filter to exclude the footer page from the ajax search.
add_filter('avf_ajax_search_query', 'avf_ajax_search_query_mod', 10, 1); function avf_ajax_search_query_mod( $search_parameters ) { $footer = avia_get_option( 'footer_page', 0 ); $defaults = array('numberposts' => 5, 'post_type' => array( 'post', 'portfolio', 'document' ), 'post__not_in' => array($footer), 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => false); $_REQUEST['s'] = apply_filters( 'get_search_query', $_REQUEST['s']); $search_parameters = array_merge( $defaults, $_REQUEST ); return $search_parameters; }
Best regards,
IsmaelJune 13, 2018 at 8:15 pm #972456This reply has been marked as private.June 14, 2018 at 4:24 pm #972879Hi Doug,
This code goes to the functions.php and yes, it can be used on other Enfold websites.
Best regards,
VictoriaJune 14, 2018 at 8:46 pm #972996Thank you!
The code makes the search malfunction. I think I’ll come back to this subject later. Thank you for your efforts although it’s not working.
Best Regards,
Doug
- This reply was modified 6 years, 6 months ago by doug123.
June 15, 2018 at 10:18 am #973209Hi Doug,
Can you please be more specific as to how the code makes the search malfunction?
Best regards,
VictoriaJune 15, 2018 at 7:45 pm #973424Hi Victoria – thanks for sticking with this – I don’t want to be a pain.
The code you sent me in an email has a lot of “” in it, so WordPress won’t accept it. I understand now that email made this happen. So – I tried the code above from Ismael. WordPress accepted it.
however, the result was that the search couldn’t find much. Kind of like the search’s Intelligence Quotient went down 50%! It couldn’t find really simple things.
Am I making sense? I didn’t know this was going to be as difficult to solve. Perhaps I should send you login credentials so you can have a go at it?
I do think this is something your customers are going to want and need. I know I will need it for every site I make using Enfold ( A lot of sites – it’s the only theme I use for clients).
Kind Regards,
Doug
June 17, 2018 at 4:21 pm #973921Hi Doug,
Please, do not copy the code from the email, come to the forum and copy it from here. The link is below.
Best regards,
VictoriaNovember 30, 2018 at 2:34 pm #1039314I tried this code – it does not work! NOTHING now shows in the ajax search.
I am trying to find a solution so that the custom footer page does not show in the AJAX search OR the main search page.Why has this not been tested before you rolled it out? Surely, this should have been on the design spec so that custom footer content is NOT included in search results.
December 1, 2018 at 4:26 pm #1039675Hi,
The code should have worked but every site is built with different settings and custom code. There may be something that’s causing this issue.
For testing purpose, try the code on a fresh installation and I’m sure it will work but that’s not how all sites are and I value your feedback.
Since the code is not working for you, please remove it and let’s try a different approach.
Please try installing this plugin https://wordpress.org/plugins/search-exclude/ and select the page you want to exclude from the WordPress search result in the plugins settings on the pages.
Best regards,
VinayDecember 17, 2018 at 7:20 pm #1046450Hi @Vinay,
I believe you have now accepted this as a bug in my post – https://kriesi.at/support/topic/custom-footer-page-how-to-prevent-it-appearing-in-search-results/#post-1046422
The only reason “every site is built with different settings and custom code is because of issues like this – your theme not working properly and you keep throwing out code here, there and everywhere instead of fixing the issues and putting them in the core. Please, just make the theme work as expected.
If you think it works as expected, then please stop using programmers to design the software.
Regards to @kriesi
HDecember 19, 2018 at 2:14 am #1047073Hi,
Yes, the latest patch should take care of that issue.
Latest additions to the core:
custom 404 page without reroute
supports ALB and Layerslider on 404
supports WPML
supports YOAST to hide special pages from sitemap (404, maintenance mode, footer)
returns 404 for users who access these pages from frontend (need edit post capability)
Maintenance Mode Page without reroute
Move logic for custom pages in own class
Improve user info for special pages
———hide special pages (404, maintenance, footerpage) from being displayed in page lists (frontend)
———Exclude special pages from search results (also ajax search)‘
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.