WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

May 25 2011

Remove or Change Post Info or Post Meta

To remove the post meta, simply use the following code:
[php]// Remove post meta
remove_action('genesis_after_post_content', 'genesis_post_meta');[/php]

To customize the post meta, simply use the following code:
[php]// Customize the post meta function
add_filter('genesis_post_meta', 'post_meta_filter');
function post_meta_filter($post_meta) {
if (!is_page()) {
$post_meta = '<span class="categories">Filed Under: </span> ';
return $post_meta;
}}[/php]

To remove the post info, simply use the following code:
[php]// Remove the post info function
remove_action('genesis_before_post_content', 'genesis_post_info');[/php]

To Customize the post info, go to my post here How to Edit Author, Date, Time, Comments Link, Tags and Categories (Post Information) in Genesis.

Written by Travis Smith · Categorized: Genesis, Tutorials

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Marco says

    June 20, 2011 at 4:52 am

    Hello, nice roundup of CPT Genesis related tutorials.
    I’d like to ask if you have a quick snippet to conditionally replace the post meta in CPTs with their own custom taxonomies; all done via functions.php and not via a custom template.
    Cheers
    Marco

    Reply
    • wpsmith says

      June 20, 2011 at 5:11 pm

      Hello Marco,

      Here is some ad hoc code that will help get you started without knowing your taxonomies or your custom post types. To customize the post meta, simply use the following code:
      [php]// Customize the post meta function
      add_filter(‘genesis_post_meta’, ‘post_meta_filter’);
      function post_meta_filter($post_meta) {
      if (is_post_type(‘my_cpt’)) {
      //get your terms via get_terms( $taxonomies, $args ); $taxonomies can be an array of taxonomies
      //$myterms = get_terms(‘my_tax’, ‘orderby=count&hide_empty=0’);
      //$output = ‘<ul>’;
      //foreach ($myterms as $myterm) {
      //$output .= ‘<li>’.$myterm->name.'</li>’;
      //}
      //$output .= ‘</ul>’;
      //$post_meta = ‘<span class="mytax">Filed Under:’.$output.’ </span>’;
      return $post_meta;
      }}[/php]

      For more information, check out the WordPress codex for get_terms.

      Reply
      • Marco says

        June 23, 2011 at 2:24 pm

        Many thanks. I solved by echoing get_the_term_list for each custom taxonomy.

        Reply
    • Amin says

      June 29, 2011 at 6:40 pm

      I don’t know what to do with this code – I have a custom post template and wanted to display the custom taxonomies. This gives a blank putting it either in the template or functions file.

      To customize the post meta, simply use the following code:

      // Customize the post meta function
      add_filter(‘genesis_post_meta’, ‘post_meta_filter’);
      function post_meta_filter($post_meta) {
      if (!is_page()) {
      $post_meta = ‘Filed Under: ‘;
      return $post_meta;
      }}

      Reply
      • wpsmith says

        June 30, 2011 at 3:54 pm

        Hello Amin,

        Place the code in your functions.php file after the require_once statement.

        Thanks,

        Reply
  2. vodkarusskaya says

    January 11, 2012 at 1:44 am

    I was trying to remove the post meta and the post info for hours until i saw this thread. Travis Smith – god bless you!

    Reply
  3. Ana says

    August 14, 2012 at 4:15 pm

    Hi Smith. I want to remove “Filed Under:” and “Tagged With:” but to let only default icons, and function to exist.
    Something from: (category icon here) Filed Under: Uncategorized (tag icon here) Tagged With: whatever
    To this: (category icon here) Uncategorized (tag icon here) whatewer
    Is this possible somehow?
    Thanks

    Reply
    • Travis Smith says

      August 14, 2012 at 8:01 pm

      Hello Ana,

      Yes, just use CSS to have the icons appear and delete Filed Under and Tagged With.
      [php]<?php
      // Customize the post meta function
      add_filter( ‘genesis_post_meta’, ‘wps_post_meta_filter’ );
      function wps_post_meta_filter( $post_meta ) {
      if ( ! is_page() ) {
      $post_meta = ‘<span class="categories"></span> [ post_comments]<span class="tags"></span> [ post_tags]’;
      return $post_meta;
      }
      }
      [/php]

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in