vertical menu bar

You can either use a filter in your functions.php file: function mytheme_nav_menu_css_class($classes, $item, $args) { if($args->theme_location == ‘secondary’) { $classes[] = ‘your-class-name’; } return $classes; } add_filter(‘nav_menu_css_class’,’mytheme_nav_menu_css_class’); Or if you go to your WP Admin, click Appearance -> Menus and then click the tab at the top “Screen Options”, you can tick CSS Classes which … Read more

WordPress on AWS with ELB

Finally I managed to solve this issue. The problem i had was on the ELB with the sticky sessions. I just enabled it and set a time of 3600 and now wordpress in login in users. A question remains with the real ELB power. If you do this sticky session I found some documentation that … Read more

Cron schedule not updating after run

You can use wp-cli to execute schedules without the detour via http request. Add in crontab -e. */30 * * * * wp cron event run –path=/path/to/wp-docroot By this you wont run into maximum execution time problems which could be the reason why you schedule execution got stuck.

Simple ajax call not working in wordpress plugin

You have to put the name of your wp ajax action in your data when you do the ajax call. I assume the ajax url is correct. jQuery( document ).ready(function(){ //alert(“Jquery Loaded”); jQuery(“#pub_search”).click(function(){ alert(“You clicked”); event.preventDefault(); var term= $(“#sterm”).val(); console.log(‘your term send: ‘+term); var data = {‘nwterm’: term, ‘action’: ‘litsearch’} $.get(litsearch.ajaxurl, data, function(data){ $(“#container”).html(data.response); }); … Read more

How to Display child post on his parent post with thumbnail and content in WordPress

Just to check I understood your question, you want to display child posts under each parent post? In that case you have to write one more WP_Query inside your while loop, with parent as current post in loop. Something like: if ($query->have_posts()) : ?> <?php while ($query->have_posts()) : $query->the_post(); ?> <div class=”col-md-3 col-sm-6 wow fadeInRight”> … Read more

Exclude admin from user list

You could use user_can( $user_id, ‘manage_options’ ) to gauge the ids in the users array and unset($users->[$x]) the appropriate row. I would personally use $users = array(); foreach ($results as $user) if (!user_can( $user->ID, ‘manage_options’ )) $users[] = $user; But that’s just me.

How to Orderby Comments by post title?

The WP_Comment_Query class supports ordering by: ‘comment_agent’, ‘comment_approved’, ‘comment_author’, ‘comment_author_email’, ‘comment_author_IP’, ‘comment_author_url’, ‘comment_content’, ‘comment_date’, ‘comment_date_gmt’, ‘comment_ID’, ‘comment_karma’, ‘comment_parent’, ‘comment_post_ID’, ‘comment_type’, ‘user_id’, ‘comment__in’, ‘meta_value’, ‘meta_value_num’, There’s a way to adjust it via filters so we can support ordering by the post title: $args = [ ‘status’ => ‘approve’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => … Read more