Jump to content
Sign in to follow this  
fintan

Editing the template.postloop.php to include a plugin in Search results

Recommended Posts

fintan

Hi I'd like to include inventory from the plugin Inventory Manager in my search results. The plugin makers give instructions on how to edit the search.php file that is found in the default WP theme and I've worked out by reading other discussions here that it's the template.postloop.php file that I need to alter but I'm pretty green in this area, the plugin instructions on where to add code in the search.php is: ' See below for an example, based on the code from the Twenty-Ten theme:

*Code to be inserted -->* <?php inventory_display(); ?> <?php if ( have_posts() ) : ?>

<?php printf( __( 'Search Results for: %s&;squo, 'twentyten' ), '' . get_search_query() . '' ); ?>

<?php /* Run the loop for the search to output the results. * If you want to overload this in a child theme then include a file * called loop-search.php and that will be used instead. */ ' If anyone can point me to the right spot, I'd really appreciate it, many thanks -- Fintan

Share this post


Link to post
Share on other sites
Kate
Hi Fintan, There's an area in template.postloop.php for the search. Try to locate this: [code]
[/code] You could input your code below that. So, it would be something like this: [code]
[/code]

Share this post


Link to post
Share on other sites
fintan
Hi Kate Thanks for the help, really appreciate you taking time to help. Doesn't seem to work though; I'm wondering does the syntax look correct or does PP need some additional code - given that the template.postloop.php holds this set of search functions as opposed to the search.php that the plug-in makers use as an example? Thanks again -- Fintan

Share this post


Link to post
Share on other sites
Rob
I've bumped this up to a developer for attention as its potentially more complex than usual for the forum.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
fintan
Thanks rangelone, looking forward to seeing what they say. -- Fintan

Share this post


Link to post
Share on other sites
fintan
Hi rangelone Is there any update on this? I'm thinking that maybe when I accepted your answer that I 'closed' the issue is that correct? Thanks for all your help -- Fintan

Share this post


Link to post
Share on other sites
Danny
Hi Fintan, No guarantee this will work but you could add this to your functions.php file located in /themes/platformbase/. [code] // Search Results // add_action('pagelines_before_theloop','searchresults'); function searchresults(){ if (is_search()) : ?> Add Inventory Manager code here

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
fintan
BRILLIANT! Thank you so much, that works a treat - Exactly what I wanted. Great start to the week WhouHoooo! Thanks Danny -- Fintan :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×