Using shortcode within shortcode with dynamic variable

You need to apply the do_shortcode to the content itself. Example below: function test_func( $atts, $content ) { extract( shortcode_atts( array( ‘foo’ => ‘no foo’, ‘baz’ => ‘default baz’ ), $atts ) ); return “<div class=”test”>”.do_shortcode($content).”</div>’; } add_shortcode( ‘test’, ‘test_func’ ); So in other words you need to care about the shortcode that print the … Read more

Inserting A Feed and Sidebar into an HTML Page

The typical definition of static page is plain text file, typed by hand or generated by software either. By definition static pages cannot have back-end powered dynamic functionality. There are quite a few approaches to integrating WP (or anything really) with static page, typical being: convert static page to dynamic completely – turn it into … Read more

How to have post count after each listed category

For showing category count on your loop – foreach($categories as $category) { echo ‘<li><a href=”‘ . get_category_link( $category->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in: %s” ), $category->name ) . ‘” ‘ . ‘>’ . $category->name.'</a>&#32;&rsaquo; (‘. $category->count .’)</li>’; } And for showing count with wp_get_archives function, use show_post_count in argument … Read more

Have multiple loops on a page appear after/between page content

Use buffer to simply do that with ob_start() & ob_get_clean(). function custom_summary($atts) { extract(shortcode_atts(array( “category” => “”, “posts” => “” ), $atts)); ob_start(); $my_query = new WP_Query(“category_name=$category&posts_per_page=$posts”); while ($my_query->have_posts()) : $my_query->the_post(); // Do all the things. endwhile; wp_reset_postdata(); return ob_get_clean(); } add_shortcode(‘summary’, ‘custom_summary’);

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