This site's Website Portfolio page displays portfolio custom post types. Actually, I borrowed the portfolio code from the Genesis Executive Pro theme and customized it to work with the Parallax Pro theme that we use on this site. While copying the php code, CSS, and templates from the Executive Pro theme is a pretty straight forward affair, I wanted the portfolio custom post types to be ordered alphabetically instead of the WordPress default reverse chronological order. To achieve this effect, I added the following code to the theme's functions.php file:
//* Sort the portfolio thumbnails alphabetically add_filter("posts_orderby", "vmf_orderby_filter", 10, 2); function vmf_orderby_filter($orderby, &$query){ global $wpdb; //figure out whether you want to change the order if (get_query_var("post_type") == "portfolio") { return "$wpdb->posts.post_title ASC"; } return $orderby; }
Hi Victor,
Very nice tutorial.
Could you also share your code for this portfolio template, so that I can have a better idea of how it is generated ?
Thanks,
Thomas
Thomas, the portfolio template code is from a child theme built for the Genesis Framework. The portfolio is available in many of the Studio Press themes. If you are not using the Genesis Framework, sharing code won’t be of any use to you.
Yes, I’m using the Framework. Being new to Genesis, it is a headache for me to create the template file.
Thomas,
Did you purchase just one child template or the full suite of templates. Executive Pro has a template you can copy. Actually, there are three template files for the portfolio and code in functions.php and styles.css. It’s a lot more than a single template.
Hello Victor,
Thank you so much for your guidance.