• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Show video in content for single category

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Show video in content for single category

This topic is: resolved

Tagged: category template, custom category

  • This topic has 3 replies, 2 voices, and was last updated 4 years, 4 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 14, 2018 at 6:32 pm #223213
    andrenellin
    Member

    I have a category labeled 'Video'. The client wants a page that displays all video blog posts or blog posts containing video. There are also other links to display text based blog posts. How can I edit the Custom Post Template for category video so that it will display the video content when listing all posts.

    Here is the link:

    http://dev.rewirex.com/category/video/

    http://dev.rewirex.com/category/video/
    September 15, 2018 at 4:27 am #223215
    Brad Dalton
    Participant

    Looks like it already does.

    If you want to display more content or customize how its displayed for 1 specific category, you can create a custom category template and use code.

    Creating custom category templates in Genesis is very easy.

    Use the WordPress template Hierarchy to name the file category-video.php


    Get Help – Book Consultation.

    September 16, 2018 at 7:43 am #223234
    andrenellin
    Member

    This is how I resolved it. I made show content the default for displaying blog categories which resolved the issue with video not showing in the loop. For the other category I used the following code in the page template:

    category-blog.php

    <?php
    /**
     * Template Name: Category Blog
     * Template Post Type: post
     * @package WordPress
     * @subpackage Genesis
     *
     */
    add_action('genesis_before_content_sidebar_wrap', 'do_blog_posts');
    
    function do_blog_posts() {
    
    	// Remove 'site-inner' from structural wrap
    	add_theme_support('genesis-structural-wraps', array('header', 'footer-widgets', 'footer'));
    
    	// Remove the post content
    	remove_action('genesis_entry_content', 'genesis_do_post_content');
    
    	// Display the post excerpt
    	add_action('genesis_entry_content', 'the_excerpt');
    	// add_action('genesis_entry_content', 'sc_get_excerpt', 10);
    
    //* Modify the length of post excerpts
    	add_filter('excerpt_length', 'sp_excerpt_length');
    	function sp_excerpt_length($length) {
    		return 200; // pull first X number of words
    	}
    
    // Display Category Title in the Heading Section
    	echo '<div class="background_black page_header_row text_light">';
    	echo '<div class="wrap">';
    	echo '<h1>Blog Posts</h1>';
    	echo '</div>';
    	echo '</div>';
    }
    genesis();
    
    September 16, 2018 at 8:30 am #223235
    Brad Dalton
    Participant

    The only thing you're missing is the schema for the title.


    Get Help – Book Consultation.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Show video in content for single category’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble