Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // Custom template for category landing pages - name this page category-loop.php
- // Keep in mind that you may need to either a) install the remove Category Base plugin (to remove /category/ from archive pages) or b) add a parent page to these 'landing pages' that has a slug of 'category'.
- // Get the current path.
- $page = get_page_by_path( $_SERVER['REQUEST_URI'] );
- if($page && $page->post_status == 'publish') {
- // If there is a published page that shares this path, use that as the landing page.
- // Attempt to render the siteorigin page content, or fallback to standard post_content.
- if( function_exists('siteorigin_panels_render') && $content = siteorigin_panels_render( $page->ID ) ) {
- echo $content;
- } else {
- echo apply_filters('the_content', $page->post_content );
- }
- } else {
- // Otherwise, use the default loop template to list all the posts within this category.
- get_template_part('templates/loop', get_post_format());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement