Shortcode always at top of content

You can’t just print output from a shortcode, you have to return it. Easiest way given your existing code is to use an output buffer. You can modify your draw_chain_menu() method like this: //shortcode action public function draw_chain_menu($args) { // previous code omitted… ob_start(); $this->generate_tax_select($args); return ob_get_clean(); }

How to combine array info [closed]

This should get the desired result: //Initial Array $events = array ( array ( ‘week-day’ => ‘tuesday’, ‘day-date’ => 1511841600, ‘events_ids’ => array( 83417 ) ), array ( ‘week-day’ => ‘wednesday’, ‘day-date’ => 1511913600, ‘events_ids’ => array( 83419, 12345 ) ), array ( ‘week-day’ => ‘tuesday’, ‘day-date’ => 1511830800, ‘events_ids’ => array( 83411 ) ) … Read more

Why this Read More Not working in Php?

EDIT Based on your last concern, here how I would do this. The only problem left on your code is that you are calling some HTML inside PHP without `echo. So I split all those into seperates HTML tags and called them separatly in PHP. <?php while(have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <figure class=”thubmnail”> <?php … Read more

How to hide home title on pages and posts?

If I follow what you’re explaining correctly, try adding a document title filter to the functions.php theme file. (NB: setting to only change post and pages. Search, Archive, etc, will keep original title. You can always modify accordingly.) *** EDIT: added a filter for older themes that uses wp_title. add_filter(‘wp_title’, set_custom_page_title, 99999); //NB:backward compatibility with … Read more

Whats wrong with my code? Need To add String to shortcode? [closed]

$special_id = ‘ . do_shortcode(‘[url_path_number]’)’ ; Is completely wrong. do_shortcode() is a function and shouldn’t be inside quotes, because that just makes a string that says “do_shortcode()”. I don’t even know what you’re trying to do with the dot at the beginning. $special_id = do_shortcode(‘[url_path_number]’); Is correct.

Displaying categories

get_the_category_list works on The Loop only and needs a post_id as a parameter. As a page does not have category, it won’t work by default in a page. If you want to retrieve all the categories on a page, you should use one of the following: wp_list_categories get_categories( array( ‘echo’ => false ) );