How to display Feedburner subscription count as plain text via a shortcode in post/page editor of my WordPress blog?

As TomJNowell implies, you would achieve this by integrating the Feedburner API with the WordPress Shortcode API in a plugin. However, the Feedburner APIs have been shutdown since October 20, 2012 and this is no longer possible. As Google continues to deprecate support for Feedburner, your best course of action is to pursue alternatives to … Read more

Convert my php code into shortcode

The basics of creating a shortcode are quite simple. You just need to create a function that returns the code you want to output in a string and register that function: function wpse_143641_homebox_shortcode( $atts ) { return <<<HOMEBOX <div class=”homebx01 clearfix ani-1″> <div class=”homebxhead clearfix”> <div class=”bxicon homebxicon01″></div> <div class=”bxheadtxt”>Category name</strong></div> </div> <div class=”cl”></div> <div … Read more

Multiple do_shortcode in page template

Okay, you need this: <?php echo do_shortcode(‘[your-first-shortcode]’.'[your-second-shortcode]’); ?> Just write a dot between your shortcodes… Try: <?php echo do_shortcode( ‘[vc_row][vc_column width=”1/1″][vc_accordion][vc_accordion_tab title=”Section 1″][vc_column_text]’.'[table]’.$sometabledata.'[/table]’.'[/vc_column_text][/vc_accordion_tab][vc_accordion_tab title=”Section 2″][/vc_accordion_tab][/vc_accordion][/vc_column][/vc_row]’ ); ?>

Using $this from child class inside shortcode function

Your issue is in the callable object you add: array( __CLASS__, “build_shortcode”) This translates to: array( “WC_Product_Categories”, “build_shortcode”) Which is equivalent to: WC_Product_Categories::build_shortcode(); But build_shortcode is not a static function/method, and static functions/methods do not have a $this object, because there is no object associated. What you actually want is: array( $this, ‘build_shortcode’ ) Which … Read more

Where are theme codes located for WordPress?

They’re probably referring to the functions file in your theme, functions.php. This file is loaded by WordPress during setup, and gives you an opportunity to do things or register hooks and filters. Note that this file is optional, and not every theme has a functions.php, if that’s the case just create one yourself Keep in … Read more

Create category post shortcode

Needs a complete rewrite… add_shortcode( ‘categorypost’, ‘cat_post’ ); function cat_post( $atts ) { // attributes for shortcode if ( isset( $atts[‘cat’] ) ) {$cats = $atts[‘cat’];} else {return;} if ( isset( $atts[‘posts_per_page’] ) ) {$posts_per_page = $atts[‘posts_per_page’];} else {$posts_per_page = -1;} // get the category posts $category = get_category_by_slug( $cats ); if ( !is_object( $category … Read more

Custom Field 101

I would not use custom fields or shortcodes for this functionality, I would look at filters. the_content filter and the loop_end action (just make sure that your theme uses while ( have_posts() ) in single post pages) comes to immediate mind here. These are two options which requires no modification of any of your files … Read more

Help With Creating Shortcode

It seems that extract() function sets it to false if value is not provided. There might be a better way around it, but I’ve used workaround as follows function Test($atts) { extract(shortcode_atts(array( ‘row’ => null ), $atts)); $output=”false”; if( in_array(‘row’, $atts)) $output=”true”; return $output; } add_shortcode(“test”, “Test”);

Only first shortcode gets executed

As indicated in the comments this code has nothing to do with shortcodes in the WordPress sense, but it is easy to see why it will never evaluate more than one pattern. preg_match returns true if there is at least one instance of the needle found in the haystack. So, no matter how many “shortcodes” … Read more