get_comments not working properly after WordPress v4.4 update
get_comments not working properly after WordPress v4.4 update
get_comments not working properly after WordPress v4.4 update
What you see is normal behaviour. Quoting the codex: The list of categories to select from do not display with any hierarchy, though that may be subject to change in future versions of WordPress. As far as I’m aware there is no plugin for this either.
Unless you have a very specific reason, and you know what you are doing, code like this belongs in the functions.php file or a dedicated plugin. WordPress uses two kinds of hooks to allow certain functions to be triggered at specific times. These are called Actions and Filters. https://codex.wordpress.org/Plugin_API Placing code in a file that … Read more
Moving CDN jQuery to footer does not work?
With a combination of jQuery / JavaScript and WP AJAX; you could look for an onchange event on the select box, send an ajax request to your admin-ajax.php with the year and then do a custom WP Query to return the html for the secondary drop down and append it to your dom. https://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_%28action%29 http://api.jquery.com/jquery.ajax … Read more
You create two date objects and compare with the diff() methode. $from = new DateTime( ‘1970-01-01’ ); $to = new DateTime(‘today’); $years = $from->diff($to)->y; $months = $from->diff($to)->m; echo $years . ‘ years and ‘ . $months . ‘ months.’; => 46 years and 1 months.
$bodyclasses = get_body_class(); foreach ($bodyclasses as $class) echo $class;
Few issues here. use add_filter() instead of apply_filters(), to register your custom callback. return the value within your filter’s callback. use the get_comments_number filter instead of the comments_number filter, since you only want to change the number and not the whole output of the comments_number() function. prefix the name of your custom callbacks, to avoid … Read more
Okay, figured it out! I’ve amended my theme function as follows: add_filter( ‘wp_nav_menu_items’, ‘add_loginout_link’, 10, 2 ); function add_loginout_link( $items, $args ) { if (is_user_logged_in() && $args->theme_location == ‘top_navigation’) { $items .= wp_nav_menu( array(‘menu’ => ‘menu-logged-in’, ‘container’ => ”, ‘echo’ => false, ‘items_wrap’ => ‘%3$s’) ); } elseif (!is_user_logged_in() && $args->theme_location == ‘top_navigation’) { $items … Read more
try to check you functions. That function might exist somewhere in your code. if you cant find it, then try to remove the if statement and just add your function directly like this function testimonial() { register_post_type( ‘testimonial’, array( ‘labels’ => array( ‘name’ => ‘Testimonial’, ‘singular_name’ => ‘Testimonial’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add … Read more