-
AuthorPosts
-
September 25, 2013 at 5:50 am #165923
Hi guys-
So glad you added AJAX, and ‘m having a blast with it. But when you find a portfolio item in search etc. and link to it?.. it’s broken. Like…
http://mcalpin.net/portfolio/curtis-orthodontics/
http://mcalpin.net/portfolio/messaging-promotion/How can I make these view normally… or at least send all links to portfolio items to the “Portfolio” page, where you see them all and choose from the AJAX grid, etc.?
Thanks!
September 26, 2013 at 5:42 pm #166707Hello mgma!
The only thing I can think of would be to find a plugin that can remove items from search results or to set up forwarding with a plugin so that if someone stumbles on to the single portfolio page it forwards them to the page you want instead.
Cheers!
DevinSeptember 27, 2013 at 5:13 pm #167207That’s what I was thinking… to forward them to the grid page. Can you recommend a plugin to do this? I have never seen one.
Thanks!
September 27, 2013 at 7:33 pm #167264October 7, 2013 at 4:33 pm #171695Thanks Josue. I don’t see this code in your PHP files though. Also, I should mention… I’m trying to not include portfolio posts, but want to keep regular blog posts in the searches. I’m also using a plugin… Taxonomy Picker… for searching.
Can you advise?… seems like I’m just taking guesses here.
Thank you!
October 7, 2013 at 5:27 pm #171720Hi!
Add this code at the end of your functions.php file:
function searchfilter($query) { if ($query->is_search && !is_admin() ) { $query->set('post_type',array('post','page')); } return $query; } add_filter('pre_get_posts','searchfilter');
Tested locally, does the job (excludes portfolio from search).
Cheers!
JosueOctober 16, 2013 at 6:20 am #176230Thanks Josue. Not working though. See here…
http://mcalpin.net/brian-mcalpin/
search for any of the portfolios you see here…
they’re stiill showing up, and just deliver a thumbnail… no link even.
Ideas?
October 16, 2013 at 5:32 pm #176529Try searching when not logged in to your WordPress account.
October 18, 2013 at 6:11 am #177272Nope. Still doesn’t work. They all still come up in the AJAX search.
Thanks Devin
October 20, 2013 at 8:56 am #178018Hey!
Please try Relevanssi: http://wordpress.org/plugins/relevanssi/ and this code: https://kriesi.at/support/topic/enfold-code-update-for-2-2-to-use-relavanssi-plugin/#post-168752
After the plugin installation go to the configuration page and search for the “Indexing options” – there you can select/deselect the post typesyou want to add to the search index. Deselect the “portfolio” checkbox and save the settings.
Best regards,
PeterOctober 22, 2013 at 5:29 am #178863Thanks Dude.. will check it out.
-
AuthorPosts
- The topic ‘My portfolio items a broken when not viewed with AJAX’ is closed to new replies.