Skip to content

Instantly share code, notes, and snippets.

@davidperezgar
Forked from fernandiez/functions.php
Created October 21, 2016 11:11
Show Gist options
  • Select an option

  • Save davidperezgar/efa94af7ec25e60a96aa3495246d2f13 to your computer and use it in GitHub Desktop.

Select an option

Save davidperezgar/efa94af7ec25e60a96aa3495246d2f13 to your computer and use it in GitHub Desktop.

Revisions

  1. davidperezgar revised this gist Oct 21, 2016. 1 changed file with 2 additions and 10 deletions.
    12 changes: 2 additions & 10 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,6 @@
    //* Adding WordPress Taxonomy title and description (category, tag, taxonomy)

    /**
    * Add Category Heading to Each Page in Pagination in Genesis
    * @link https://gist.github.com/neilgee/6c0414cfef06e41a6606
    * Prints a category's title and description in Genesis
    * @link https://gist.github.com/EngageWP/df43e156e76fa5cdd6c0
    */

    add_action( 'genesis_before_loop', 'rv_output_category_info' );
    function rv_output_category_info() {
    add_action( 'genesis_before_loop', 'cmk_output_category_info' );
    function cmk_output_category_info() {

    if ( is_category() || is_tag() || is_tax() ) {

  2. @fernandiez fernandiez created this gist Feb 27, 2015.
    27 changes: 27 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    //* Adding WordPress Taxonomy title and description (category, tag, taxonomy)

    /**
    * Add Category Heading to Each Page in Pagination in Genesis
    * @link https://gist.github.com/neilgee/6c0414cfef06e41a6606
    * Prints a category's title and description in Genesis
    * @link https://gist.github.com/EngageWP/df43e156e76fa5cdd6c0
    */

    add_action( 'genesis_before_loop', 'rv_output_category_info' );
    function rv_output_category_info() {

    if ( is_category() || is_tag() || is_tax() ) {

    echo '<div class="archive-description">';

    echo '<h1 class="archive-title">';
    echo single_term_title();
    echo '</h1>';

    echo term_description();

    echo '</div>';

    }

    }
    13 changes: 13 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    /* Adding WordPress Taxonomy title and description styles (category, tag, taxonomy)
    ---------------------------------------------------------------------------- */

    .archive-description {
    background-color: #ccc;
    font-size: 16px;
    margin-bottom: 20px;
    padding: 40px 40px;
    }

    .archive-title {
    font-size: 36px;
    }