• 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 custom class to meta shortcode

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 custom class to meta shortcode

This topic is: not resolved
  • This topic has 5 replies, 2 voices, and was last updated 6 years, 10 months ago by Victor Font.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • December 16, 2018 at 11:57 pm #225087
    jaychan
    Participant

    Hi,

    I have custom function:

    add_filter( 'genesis_post_meta', 'add_post_meta' );
    function add_post_meta() {
    	return '[post_terms taxonomy="mood" before="Today Moood: "] [post_tags] ';
    }

    How can I add custom class wrap 'Today Moood:'?

    Thank you.

    December 17, 2018 at 6:17 am #225088
    Victor Font
    Moderator

    If you just want to add a class to the before text, include the HTML markup with the text like this:

    add_filter( 'genesis_post_meta', 'add_post_meta' );
    function add_post_meta() {
    	return '[post_terms taxonomy="mood" before="<span class='today-mood'>Today Moood:</span> "] [post_tags] ';
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 17, 2018 at 6:41 am #225093
    jaychan
    Participant

    Hi,

    I tried but got error:

    syntax error, unexpected 'today' (T_STRING), expecting ';'

    Do you know what is the issue?

    Thank you.

    December 17, 2018 at 9:15 am #225101
    Victor Font
    Moderator

    I tested what I gave you before and it works fine. The error means your PHP is wrong. I can't tell you what's wrong unless you post the code.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 17, 2018 at 9:55 am #225102
    jaychan
    Participant

    Hi,

    I copied your code to Code Snippets and got error:

    The code snippet you are trying to save produced a fatal error on line 3:
    
    syntax error, unexpected 'today' (T_STRING), expecting ';'

    I did not make any change.

    December 17, 2018 at 1:05 pm #225106
    Victor Font
    Moderator

    Just by adding the code to your function, you've made a change. You have a syntax error in your code.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 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