• Resolved archtheme

    (@archtheme)


    *Sigh* Didn’t know HTML and shortcode support was removed in the new update, and my website was not displaying correctly for god knows how long. Not very thrilled.

    I have since found the hack around supporting HTML from some of the topics here, but my shortcode is still not displaying properly.

    How can I add shortcodes to Announcements?

    Thanks for your help.

    https://wordpress.org/plugins/timeline-express/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hi,

    Sorry that you are having some difficulties during the upgrade. This was listed in our change log, in the hopes that users would read it before upgrading.

    The shortcode should work the same way as with any standard page or post. When you added the code snippet for HTML excerpts in your functions.php file, is it wrapped in apply_filters( 'the_content' ). The shortcode is parsed by WordPress via the_content filter.

    Using the two snippets in the documentation – I was able to use shortcodes in my excerpt without any issues.

    I added the following to my functions.php file

    function bartag_func( $atts ) {
    	$atts = shortcode_atts( array(
    		'foo' => 'no foo',
    		'baz' => 'default baz'
    	), $atts, 'bartag' );
    
    	return "foo = {$atts['foo']}";
    }
    add_shortcode( 'bartag', 'bartag_func' );

    And used the shortcode [bartag] in the custom excerpt field.

    Thanks,
    Evan

    Plugin Author Evan Herman

    (@eherman24)

    I have just pushed out a new update and confirmed that short codes should be working fine. If not, please post back here.

    Thanks,
    Evan

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Shortcodes in Announcement’ is closed to new replies.