Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

Shortcode returns values in the wrong order

it is b/c wp_list_pages ECHOES by default. so it echoes before your return happens. wherever you are defining your $args, set ‘echo’ => FALSE, see http://codex.wordpress.org/Function_Reference/wp_list_pages

OOP and WordPress shortcode

That is not the way you add an object method as a callback. function make_shortcode() { add_shortcode(‘ShowMsg’, array($this,’ShowMsg’)); } This is explained in the Codex as it pertains to actions and filters, but the principle is the same. I should add that anonymous classes make for painful debugging. Instantiate that class to a variable. It … Read more

problem with shortcodes nesting

put the remove filter to be called first like this, change your span to div or you will have issues with some browsers: remove_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘wpautop’ , 12); function twoColPostcardfn($atts, $content){ extract(shortcode_atts(array( ‘image’=>”, ‘text’=>”, ‘title’=>”, ‘boxlink’=>”, ‘float’=>” ), $atts)); $bob='<div class=”twoColPostcard “>’.$content.'</div>’; return $bob; } add_shortcode( ‘twoColPostcard’, ‘twoColPostcardfn’ ); or change … Read more

wp_list_pages shortcode jumps above previous content

That’s because your list is printed immediately. wp_list_pages() has the echo parameter, which is true by default. Make it false like here: <?php function roofspan_product_childpages() { $list_p = array( ‘sort_column’ => ‘menu_order, post_title’, ‘child_of’ => ’12’, ‘title_li’ => ‘Products: ‘, ‘echo’ => 0 // Note this ); return wp_list_pages( $list_p ); } add_shortcode( ‘product_childpages’, ‘roofspan_product_childpages’ … Read more

How to filter a query by date in a shortcode?

Note that you’re returning from the shortcode’s callback with: return $pops_content; before removing the filter’s callback with: remove_filter(‘posts_where’, ‘filter_where’); So it’s never called. That means you’re affecting all the later WP_Query instances with your filter. Note that you can use date_query in WP_Query instead, so you don’t need the posts_where filtering.

Shortcode to display the latest news article within a page

In functions.php file : function my_recent_post() { global $post; $html = “”; $my_query = new WP_Query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 1 )); if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post(); $html .= “<h2>” . get_the_title() . “</h2>”; $html .= “<p>” . get_the_excerpt() . “</p>”; $html .= “<a href=\”” . get_permalink() . “\” … Read more

Wrap text around shortcode

Without seeing your show_sticky_posts, show_lastest_posts, show_lastest_missions,show_all_posts_from_categories i can guess that the shortcode content is always before the post content beacuse this functions are echoing/outputing the result and a shortcode should return content instead so you can try using output buffer of PHP like this: function show_posts_handler( $atts, $content=null, $code=”” ) { //code 4 displaying extract( … Read more