New Template — copy existing template and change code? [duplicate]

For custom templates, I tend to use the default page.php, make any changes to the HTML (if need be), and enqueue an overriding stylesheet before get_header(): /** * Template Name: My Page Template */ wp_enqueue_style( ‘my-page-template’, get_template_directory_uri() . ‘/css/page-template.css’ ); get_header(); Everything’ll function like a normal page, except now you have a stylesheet for declaring … Read more

Exclude a category from the filed under list only on some templates

You can add conditional statements before applying the logic to modify the categories. For example, I added a check that will bail and return the unmodified list of categories if we’re not on the category archive page: // Add the filter to ‘the_category’ tag. add_filter( ‘the_category’, ‘the_category_filter’, 10, 2 ); function the_category_filter( $thelist, $separator=” ” … Read more