Community Forums › Forums › Archived Forums › Design Tips and Tricks › where to start when building a child theme
Tagged: child theme, Custom fields, custom post types, Getting Started
- This topic has 3 replies, 3 voices, and was last updated 9 years, 11 months ago by Andrea Rennick.
-
AuthorPosts
-
May 24, 2014 at 7:13 am #106588hilda_rMember
Hi,
I'm very new to Genesis. I'd been considering buying it for a while since I'd heard so many good things about it and a few days ago I took the plunge. What I want to use it for, is to create websites with lots of custom post types and custom fields using the Advanced Custom Fields plugin.
So far, I've read a few tutorials, and most of them seem to lean towards copy all the css from the Genesis core and then customize based on that. I have yet to find a tutorial that teaches you how to build anything custom, because most of them seem to be based on using a starter theme and then doing minor alterations to it. There's nothing showing you how to actually work with genesis when you have plenty of information coming from custom post types with custom fields. I would love to see a tutorial of that, if anyone has come across one.
I haven't actually gotten anywhere yet on building my own site, because I find the whole thing quite confusing. Especially the fact that it seems any alterations should go in the functions.php file. Is that the right way to do it? Just using the functions.php file for everything? Because I'm used to creating a header.php, footer.php, front-page.php, single.php etc and doing all changes in those files, but I haven't seen a single tutorial that suggests doing it that way, so I've assumed it's the wrong way to do it.
How would you go about building a site with multiple custom post types (for instance one for a gallery and another for displaying a project portfolio) with custom fields in the correct way of building a site with Genesis? Is it okay to create the files I mentioned above, or should I just use actions to add functions to the hooks?
And, again, if someone has a link to a tutorial showing how to build more advanced child themes with custom post types using Genesis, I'd love it if you could give me links to them.May 24, 2014 at 9:13 am #106602nutsandboltsMemberHi Hilda,
You're correct that most Genesis child themes use a stylesheet and functions.php, though they may also include a few custom templates for displaying archives, a portfolio, the homepage, etc. It's pretty typical to see a child theme with a front-page.php, but generally hooks are used for header/footer, single posts, etc.
While some child themes do include custom post types, it's generally considered a best practice to use a functionality plugin for CPTs so the content isn't lost if the site owner changes themes at some point in the future. Ultimately it's up to the designer/dev but it's something to consider. More on that here: http://justintadlock.com/archives/2013/09/14/why-custom-post-types-belong-in-plugins
I think the best way to learn to create custom child themes for Genesis (and the way I learned when I started) is to look at some of the existing child themes, how they're structured, and where changes are made. A couple of child themes use a recipes CPT (Foodie is one in particular that comes to mind), some of them use real estate listing CPTs (Winning Agent), and many, many of them use a portfolio CPT, but more often people are creating plugins to house those changes, then including templates within the child theme for displaying the info from custom fields.
I'm not sure if that helps or makes things more confusing, Robin Cornett is a Genesis dev who frequently uses CPTs as plugins within custom child themes, so she may be a good person to reach out to: http://robincornett.com
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+May 24, 2014 at 1:03 pm #106622hilda_rMemberHi Andrea,
Thank you, that's very helpful. Based on the tutorials I was reading I was starting to think you weren't supposed to add any page templates, and that all code needed to be added in the functions.php. I just saw that functions file growing to be huge and impossible to work with.
So, to create my website I'll use functions.php to work with the hooks for header, footer, singe, archive etc. All the regular files. Then, for any custom post types (which I'll be creating via a plugin), I'll add page templates.
I've done a few regular WP themes/websites, but it's so different with Genesis and it's a bit overwhelming at first. Thank you for taking the time to answer my question.
// Hilda
May 25, 2014 at 6:07 am #106659Andrea RennickMemberYou can start with the sample custom theme we provide as well. It's pretty bare.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.