WordPress.org

Forums

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

  1. Copernicus
    Member
    Posted 1 year 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. Anthony Hortin
    Inactive
    Theme Author

    Posted 1 year 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 1 year 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. Anthony Hortin
    Inactive
    Theme Author

    Posted 1 year 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 1 year 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. Anthony Hortin
    Inactive
    Theme Author

    Posted 1 year ago #

    Glad it all works for you :-)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic