Jump to content
Sign in to follow this  
jh5672@jlh.com.au

Search Boxes content

Recommended Posts

jh5672@jlh.com.au

Hi everyone, I want my website search to locate content from Boxes. I am using Boxes to showcase affiliate companies and want them to be found if a visitor searches for them. Thanks, Joe WP 3.3.1 PageLines Framework 2.1 Base Theme 1.0.2.

Share this post


Link to post
Share on other sites
Simon
You cannot display a box post, its a custom post type. You can include the results with this filter, but if they click it it will just show a 404. [code]function filter_search($query) { if ($query->is_search) { $query->set('post_type', array('post', 'boxes')); }; return $query; }; add_filter('pre_get_posts', 'filter_search');[/code]

Share this post


Link to post
Share on other sites
jh5672@jlh.com.au
Thanks Simon. Not ideal of course. The boxes present the entries beautifully, allowing a 4 x N grid of records (Title + description). Can you think of another way to achieve this? Typical searches will be based on key information such as name or postcode that are embedded in the description.

Share this post


Link to post
Share on other sites
Simon
The box contents are not directly viewable. No other way around it, sure you can add them to the search and get results, but you cant actually click the results links because the box posttype isn't publicly viewable.

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  

×