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

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’);

Buddypress Group Activity Loop Filter activity type [closed]

I have created this function in bp-custom.php page. function filtering_activity_default( $query ) { if ( empty( $query ) && empty( $_POST ) ) { $query = ‘action=activity_update,joined_group’; } return $query; } add_filter( ‘bp_ajax_querystring’, ‘filtering_activity_default’, 999 ); This is working for me as expected.

Need a conditional to test if title of parent page matches title of child page

solution here as function: function testchildren () { global $post; $childtest = get_pages(‘child_of=”.$post->ID); if( count( $childtest ) != 0 ) { return false; } else { return true; } } and implementation as markup: <?php if (have_posts()) : while (have_posts()) : the_post() ; ?> <h2><?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?> </h2> <?php if ( … Read more

Set loop format & have a loop inside other one

You can easily achieve this by using a multiple loop, or a loop inside a loop. Let’s assume you have your normal page template with the standard WordPress loop, outputting your wrapper <div class=”page”> and the title: <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class=”page”> <div class=”title”> <?php the_title(); ?> </div> <!– … Read more

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