• 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

Add category description in code

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 › Design Tips and Tricks › Add category description in code

This topic is: not resolved

Tagged: category listing, grid, post teaser

  • This topic has 1 reply, 1 voice, and was last updated 10 years, 11 months ago by Mr_Vercetti.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 9, 2014 at 1:51 pm #113611
    Mr_Vercetti
    Member

    Hey all.

    So I've done some customization to my News Pro theme, which lists category pages like a grid.

    The problem is that I lost the category description which is extremely bad for my SEO.

    I added this .php file to the root of my child theme dir:

    <?php
    /**
    * This file adds the category archive template.
    *
    */

    //* Force full width content layout
    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

    //* Remove the post info function
    remove_action( 'genesis_entry_header', 'genesis_post_info', 5 );

    //* Remove the post content
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );

    //* Remove the post image
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );

    //* Add portfolio body class to the head
    // add_filter( 'body_class', 'executive_add_portfolio_body_class' );
    function executive_add_portfolio_body_class( $classes ) {
    $classes[] = 'executive-pro-portfolio';
    return $classes;

    }

    /**
    * Display as Columns
    *
    */
    function be_portfolio_post_class( $classes ) {
    $columns = 3; // Set the number of columns here

    $column_classes = array( '', '', 'one-half', 'one-third', 'one-fourth', 'one-fifth', 'one-sixth' );
    $classes[] = $column_classes[$columns];
    global $wp_query;
    if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % $columns )
    $classes[] = 'first';

    return $classes;
    }
    add_filter( 'post_class', 'be_portfolio_post_class' );

    // Category description
    echo category_description( $category->term_id );

    //* Add the featured image after post title
    add_action( 'genesis_entry_header', 'sk_category_grid' );
    function sk_category_grid() {

    if ( $image = genesis_get_image( 'format=url&size=category-image' ) ) {
    printf( '<div class="category-grid-post-featured-image">%s</div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );

    }

    }

    //* Customize entry meta in the entry header
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    // $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
    $post_info = '[post_date] [post_edit]';
    return $post_info;
    }

    //* Remove the post meta function
    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );

    genesis();

    And a link to a random category page on my site: http://mallorcaoplevelser.dk/category/restauranter-cala-mayor/

    http://www.mallorcaoplevelser.dk
    July 9, 2014 at 1:53 pm #113612
    Mr_Vercetti
    Member

    I'm just really eager to get a nice grid layout into my categories. If any of you have a better solution, please say so.

    Best regards

    Jesper

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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