WordPress.org

Ready to get started?Download WordPress

Forums

Quark
[resolved] Activating shortcodes for the custom "Footer Content" area (6 posts)

  1. Copernicus
    Member
    Posted 6 months ago #

    Thanks for this wonderful starter theme!

    Is there a way to activate shortcodes for the "Footer Content" interface (within the first tab/panel of "Appearance > Theme Options" for Quark)?

    I know the following code in the functions.php file activates shortcodes for widgets:

    add_filter( 'widget_text', 'do_shortcode' );

    But, I'm hoping that there's some way to activate shortcodes in that editor interface for 'footer content.'

    Thanks for any & all help.

  2. ahortin
    Member
    Theme Author

    Posted 6 months ago #

    That line of code you mentioned, will allow shortcodes to be used in any of the themes sidebars. So basically, shortcodes should work no matter whether you're using them in the blog sidebar areas or in the footer widget areas

  3. Copernicus
    Member
    Posted 6 months ago #

    Thanks for the reply Anthony.
    Yes, that line of code will activate shortcodes for any of the widget areas (sidebars & such); but it doesn't seem to do anything for the "footer content area" that's set within the Theme Options panel.

    So, I don't mean footer widgets, but the extra text area in the Quark theme options where you can enter content that will display at the very bottom of the site's pages.

  4. ahortin
    Member
    Theme Author

    Posted 5 months ago #

    On line 57 of footer.php, try changing the line to read...

    echo do_shortcode( apply_filters( 'meta_content', wp_kses_post( of_get_option( 'footer_content' , quark_get_credits() ) ) ) );

    This will run the footer content from the theme options through the do_shortcode WP function, which interprets the shortcodes.

  5. Copernicus
    Member
    Posted 5 months ago #

    YES. That works perfectly. Thank you so much! Since this credits section is often used for a copyright, it's nice to be able to create a "[year]" shortcode that displays the current year and use it in this area. Thanks again (for this & the great theme)!

  6. ahortin
    Member
    Theme Author

    Posted 5 months ago #

    Glad it all works for you :-)

Reply

You must log in to post.

About this Theme

About this Topic