Shortcode in Widgets

Community Forums Forums General Discussion Shortcode in Widgets

This topic is: not resolved

This topic contains 6 replies, has 3 voices, and was last updated by  Bill Murray 1 year, 9 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #13952

    iconitrax
    Participant
    Post count: 43

    Hello,

    I am trying to place a shortcode inside a widget on a home page, can you please tell me if i need any special plugin or if there is specific instruction that i need to follow. Thank you.

    Delicious Child Theme 1.0.1
    Genesis 1.8.2

    #13966

    Brian Bourn
    Participant
    Post count: 98

    You can add this to your theme’s functions.php file to execute shortcodes in a text widget

    [php]//***Execute Shortcodes In Text Widgets**/
    add_filter(‘widget_text’, ‘do_shortcode’);[/php]


    Bourn Creative | bourncreative.com | Twitter

    #13971

    iconitrax
    Participant
    Post count: 43

    Hi Brian, Can that be added anywhere in the unction.php file or does it have to be in a certain place?

    #13972

    Brian Bourn
    Participant
    Post count: 98

    Near the bottom is usually best.


    Bourn Creative | bourncreative.com | Twitter

    #13973

    iconitrax
    Participant
    Post count: 43

    Thank you.

    #13975

    iconitrax
    Participant
    Post count: 43

    Well that didn’t work. It also crashed my site

    http://www.realestate-homeloans.com/

    #13996

    Bill Murray
    Participant
    Post count: 575

    The code Brian posted is fine. To fix the fact that your site has crashed, replace the broken functions.php with a working good one. If you haven’t made many changes to your functions.php, you can use the one that came with your original download. You can rename the modified version to something like functions.txt to preserve any modifications until you get this sorted out.

    Crashing your site is caused by a PHP error, which is always a risk when you edit your functions.php.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.