• I put in the functions php

    function alertBox($atts, $content=null, $code=""){
    		$box = 'Hello, World!';
    		return $box;
    	}
    
    	add_shortcode('box','alertBox');

    but when I put into the post [box]this is an alert box[/box]

    all I get on the page is [box]this is an alert box[/box]

    it does not display the box.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you tried renaming your function and/or your shortcode? It’s possible that one or the other is conflicting with an existing item in WordPress (as “box” and “alertBox” are pretty generic/common names).

    Thread Starter cybershot

    (@cybershot)

    I figured out that its because its a page template. I can’t get it to work in the template files. It works everywhere else, just not the templates

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘help with shortcodes’ is closed to new replies.