• 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

Enable Shortcodes in Authority Pro Top Banner Section

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 › Enable Shortcodes in Authority Pro Top Banner Section

This topic is: not resolved

Tagged: authority pro, do_shortcode

  • This topic has 5 replies, 3 voices, and was last updated 7 years ago by jdcohan.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • December 7, 2018 at 9:21 am #224882
    jdcohan
    Member

    How would I enable shortcodes in the Authority Pro Top Banner Section?

    I already have this in my mu-plugins/functions.php, which works for all widets:

    add_filter( 'widget_text', 'shortcode_unautop');
    add_filter( 'widget_text', 'do_shortcode');

    But that doesn't help.

    Jeff

    December 7, 2018 at 9:53 am #224883
    jdcohan
    Member

    Update:

    The space character in my shortcode is being converted to the %20 entity.

    The site is here (still under development):

    The shortcode in question is a basic permalink-embed, which works everywhere else on the site:

    function nwb_permalink_embed($atts) {
    	extract(shortcode_atts(array(
    		'id' => 1,
    		'text' => "" // default value if none supplied
    	), $atts));
    	if ($text) {
    		$url = get_permalink($id);
    		return "<a href='$url' title='$text'>$text</a>";
    	} else {
    		return get_permalink($id);
    	}
    }
    add_shortcode('linkto', 'nwb_permalink_embed');

    And here is the contents of the Top Banner:

    <a href="[linkto id='239']">Check out Dr. Nick Scalzo's article</a>, <em>Memory Loss? Corporate Knowledge and Radical Change</em>

    But the rendered hyperlink shows the shortcode code, not the converted hyperlink. It was only after copying the link location and pasting it into my editor that I noticed the culprit:

    http://ontracktraining.info/[linkto%20id='239']

    Namely, the space character after linkto is being converted to the %20 entity.

    Does anyone have any thoughts on how to address this? Thanks.

    Jeff

    December 7, 2018 at 10:19 am #224884
    jdcohan
    Member

    Update #2:

    I now see that the customizer calls the WordPress wp_kses_post function, which sanitizes the content. Hence the URL-encoding of the space, right?

    So, while this is now technically a WordPress issue and not a Genesis Authority Pro issue, I sure would appreciate advice on how to circumvent the "problem".

    (I have skimmed through wp-includes/kses.php, but the solution has not jumped out at me.)

    Thanks.
    Jeff

    December 7, 2018 at 9:32 pm #224902
    Brad Dalton
    Participant

    Try this solution


    Tutorials for StudioPress Themes.

    December 8, 2018 at 12:55 am #224905
    payalmisra
    Member

    thanks

    December 15, 2018 at 4:24 pm #225068
    jdcohan
    Member

    That did it, Brad. Thanks so much.

    Jeff

  • 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