If you have already read my post about how to add multiple portfolio style category archive pages using the Crystal child theme, you’ll love this post. The reason you’ll like it is because its far easier to do using the Balance child theme than using Crystal.
That really does show you the way Copybloggers StudioPress are improving their range of themes as they only get better and easier to customize.
In this post, i’ll provide you with all the code i have edited and tested which has all been modified using existing code included in the balance theme files.
Here’s the result to provide this method works, and works well.
Please click the Gist link and copy the code from the view raw link to paste into 3 separate files.
Code
- The functions.php code goes at the end of your child themes functions.php file
- The page_catarc.php code gets pasted into a new PHP file and added in the root directory of your child theme folder.
- The style.css code goes at the end of your child themes style.css file.
Portfolio Images
The first portfolio category archive is named portfolio and the second one is catarc.
Rinse & Repeat
This method works beautifully and makes it easy to convert all your category pages to a more visually appealing way of displaying different posts in all your categories.
Hi Brad,
Thanks for this tutorial. I got everything to work the first time when I used the code you provided. But when I went to do this again to create additional category pages I keep getting this error message: Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘lifestyle_photography_widget’ not found or invalid function name in /home/laceandl/public_html/wp/wp-includes/plugin.php on line 429
Are there specific things I should do differently to create more of these? I just followed your instructions again and replaced ‘catarc’ with the name of a category that I wanted to use from the site.
Any thoughts are helpful. Thanks!
Hello Cara
There’s generally different ways to get the same result.
This works well on some themes under specific circumstances.
The error is caused because you have changed the function name which needs to match the 2nd parameter ($function_to_add) in the action hook. http://codex.wordpress.org/Function_Reference/add_action
I would use a different method if you want archive pages to display in a grid when your theme includes a portfolio CPT.
Thanks for your thoughts. If I switched to a theme that had genesis portfolio already installed would it work better?
You could test it out on Executive Pro or add the code from Executive Pro to any theme.
Another option is to use CSS which you can use on any archive on any theme. http://wpsites.net/web-design/archive-page-grid-style-columns-using-css/
HI Brad,
Thanks for the code, this is exactly what I’ve been looking for, only I’m a novice and I’ve hit a snag. I followed all the instructions but I can’t figure out how to add the catarc page from my WordPress dashboard. I’ve looked under widgets and page templates and it’s not there. And should the new php file show up in the editor?
Thanks!
Hello Stephanie
It will be under Page Attributes as long as you have uploaded the template file to your child themes root directory.