Currently the search results displays the posts in two columns. I'd like to display content in three or four columns. Is there a way to make that adjustment in the search.php file?
Search results / display posts in three or four columns
(3 posts) (2 voices)-
- ChuckPosted 6 months ago #
-
You can use the bfthumbs shortcode with the new shortcode template system. See this video (I set the search to 3 columns in that video).
Posted 6 months ago # -
Here's a short tutorial (to clarify some stuff that was not shown in the video):
1. Enable the "Enable Custom Templates Feature" theme setting.
2. Create a new post in the Templates custom post.
3. Add a bfthumbs to the editor (in html mode), like this:
[bfthumbs sid="bfthumbs-loop" showposts="10" width="153" height="120" numcols="5" marginright="20" numwords="10" ajaxnav="false"]4. Select the targeting under the editor (blog, search etc.) and publish the post.
The shortcode above is a 5 column bfthumbs layout. The numcols="5" sets the number of columns, and the showposts="10" sets the number of posts shown on every page (must install wp-pagenavi or "wp page numbers" plugin for page navigation). The ajaxnav="false" parameter makes it so that it's normal page navigation (the page reloads).
The clue here is that there's no post fetching parameters in the bfthumbs shortcode (category, tag, tax etc.), so that it will show the post relevant for where it's targetted. For example, if the blog is the target then it will replace the normal blog design, but show the same posts, just with a custom design (same for the archive and search).
This makes it possible to have custom designs per category/taxonomy/custompost etc. For example a portfolio can be created with categories, and every category/taxonomy can have a different design. And there's more shortcodes for this template system, for example one for sidebars (widgetarea) and one for outputting hook content (bfhook), and also one for including php templates (bfinclude) added to a child theme (use the shortcode GUI to see the possible parameters and a description of each one).
One of the possibilities with this is also to include external php templates and target those. Just add an include shortcode with the name of a custom single.php template and it can be targeted with this system (enable the "Don't include header & footer files" setting below the targeting if the template imports the header and footer). This means that the custom single functionality is not necessary anymore since this is way more flexible, since it can target just about everything (custom post type, taxonomy type, taxonomy term, category, tag).
Another feature is to remove the header and footer html for just this template. This makes it possible to have a custom div structure (100% width designs etc.) for just the portfolio, while the blog is using the normal layout. Many possibilities with this system, and I'm exploring those with some new child themes coming soon.
Also read the changelog for version 1.4.1, since it got a lot of information about this system there. And also read this for more information and also some shortcode examples.
Posted 6 months ago #
Reply
You must log in to post.