Tag Info

Hot answers tagged

1

As Pages are a special built in Posttype, they get an own template hierarchy. Other "normal" post types and custom post types can only be templated by "single-$posttype.php". You can however hook into the single_template filter and make wordpress redirect to your template file: function get_custom_post_type_template($single_template) { global $post; ...


1

As I already mentioned in my comments, you must use pre_get_posts to add custom post types to archive pages. One thing you must keep in mind here though, you have two archive pages here, archive.php and archive-event.php, so is_archive() is going to return true on both, which will alter both pages. You will need to exclude archive-event.php from your ...


1

If you're on a page by default The Loop will only run once so why not wrap your title and content in a container where you can have post_class() available? Start your loop at the top and end it before you get to your footer (or where ever you need to end it). If you are on a blog format and are running the loop multiple times, you'll need to be in the loop ...



Only top voted, non community-wiki answers of a minimum length are eligible