Show shortcode only in posts

If I understand the question: Modify the shortcode to incorporate <?php if (is_post()) { //do this; }?> or <?php if (is_page()) { //do this; }?> or <?php if (is_home()||is_front_page()) { //do this; }?> The first will only do //do this; on a post, the second on a page, and the third if the post or … Read more

Enclosing Shortcode not working in a Template

The shortcode wraps something in header tags. For the shortcode to work you need to provide that something. Your code above works fine, you just need to set $content=”My header text”; prior to echoing the shortcode in your template. currently you are not wrapping anything in the header tags. But you shouldn’t need to use … Read more

jQuery Tabs in Shortcode API

Try This: function defaulttab( $atts, $content = null ) { $GLOBALS[‘tab_count’] = 0; do_shortcode($content) if( is_array( $GLOBALS[‘tabs’] ) ){ $i = 1; foreach( $GLOBALS[‘tabs’] as $tab ){ $tabs[] = ‘<li><a class=”tab” href=”#”>’.$tab[‘title’].'</a></li>’; $panes[] = ‘<div class=”tab’.$i.'” class=”tabcontent”>’ .$tab[‘content’].'</div>’; $i++; } $return = ‘<div class=”tabcontainer”><ul class=”selector”>’.implode( “\n”, $tabs ).'</ul> <div class=”clear”></div>’.implode( “\n”, $panes ).'</div>’; } return … Read more

contact form 7 database short codes [closed]

The Codex page for is_plugin_active explains what your problem is: NOTE: defined in wp-admin/includes/plugin.php, so this is only available from within the admin pages. If you want to use this function from within a template, you will need to manually require plugin.php, like this: <?php include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); ?> <?php is_plugin_active($plugin) ?>

Shortcode not displaying video as expected

Had a bit of a brain wave and thought I would capture the output and return it in the function. Turns out it fixed the problem so the final code ended up looking like this: function amazon_video($atts){ extract( shortcode_atts( array( ‘file’ => $file ), $atts ) ); $url = get_bloginfo(‘url’); $return = “<embed src=””.$url.”/jwplayer/player.swf” name=”player” … Read more

How to process shortcode on post save and update only

If you want to modify content when the user saves a post, you’ll want to hook in a function using the save_post hook. Within that function, you can process registered shortcodes using get_shortcode_regex which will give you the shortcodes and attributes used in that post. (However, if you want to process the content when the … Read more

Plugin renders in preview but shortcode shows when published

find the function that generates the output, or the output itself if it’s hardcoded in your page and add this function to it: <?php echo do_shortcode( $content ) ?> if your content is generated through the_post(), it’ll be: <?php echo do_shortcode( the_post() ) ?> or the_excerpt: <?php echo do_shortcode( the_excerpt() ) ?>

Twitter bootstrap tabs

Check out the WordPress Bootstrap CSS plugin. It seems to contain “handy shortcodes” to insert all sorts of elements. Also check out Obenland’s The Bootstrap WordPress theme that was released a week ago.

Iteratively add sub shortcodes to php array

Your data structure appears to be very list like. The reason you’re running into difficulties is because you’re trying to fix a fix, which is never a good thing. Instead I would suggest you seek alternative solutions to your problem. For example, instead it would be more logical to use something like: <ul class=”component”> <li>content … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)