ThemeShaper Forums » Thematic

[closed]

Custom Page Templates or Functions.php?

(6 posts)
  • Started 2 years ago by roowilliams
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Hi There,

    I have a general question about child themes. I am currently making a custom page template for a 'portfolio' section of my site. This has two custom menus which I have coded into the custom page template, and will soon have a custom loop for displaying projects how I'd like. I have copied index.php from the Thematic dir into my child theme's directory and renamed it portfolio.php and included the comment at the top to make it into a custom page template. I can now hack away at the custom page template and even code my custom loop into that, which seems straight forward and wont be affected by a Thematic upgrade.

    I am wondering whether this is the right way to do it?

    I could unhook current loops and rewrite my own and insert new menus by using action hooks which would be placed in the child theme's functions.php, or I could code straight into the custom page template file which seems to be an easier process... I am confused!

    Posted 2 years ago #
  2. Ooooh dear I just discovered custom post types, so now I can create a custom page template 'project-single.php' with a custom loop to display my custom post types 'Projects', but again I don't know whether I should go to town on this template or do everything from the functions.php...

    Posted 2 years ago #
  3. for CPTs, you have to register them in functions.php as well as provide a custom template.. aka single-project.php

    actually you don't have to create single-project.php as due to template hierarchy in the absence of that template WP will display your 'project' using the default blog template single.php

    Posted 2 years ago #
  4. But if I would find it easier to create a custom template, code a loop directly in there and just have the CPTs displayed using that, that's not going to cause me problems in the future? As opposed to using action hooks and doing everything from functions.php?

    Posted 2 years ago #
  5. I'm on custom taxonomies now and working out how to display them... it's been a rollercoaster ride today, my brain feels fried!

    Posted 2 years ago #
  6. i know what you mean. sometimes i do it one way, sometimes the other. if it is something really custom (like special CPT or tax), i usually just hard code into it.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.