Highlight parent if item from submenu is active
Use the classes current-menu-ancestor current-menu-parent and menu-item-has-children
Use the classes current-menu-ancestor current-menu-parent and menu-item-has-children
You can try this action. Put this line into your active theme functions.php file remove_action( ‘woocommerce_before_checkout_form’, ‘woocommerce_checkout_coupon_form’, 10 );
Every post has a maximum of one format and one status. To echo the format you need: if (get_post_format($post->ID)) echo ‘<span class=”format-‘ . get_post_format($post->ID); . ‘”></span>’; To echo the status you need this: if (get_post_status($post->ID)) echo ‘<span class=”status-‘ . get_post_status($post->ID); . ‘”></span>’; Hopefully this is what you need.
You could use post_class within the loop. <?php post_class( ‘myclass-here’); ?> This will add the necessary HTML class=”” and WP defaults classes plus your new myclass-here class You could then use counters within the loop to add a unique suffix to your post class // Outside the loop initialize your counter $counter = 1; . … Read more
I’m not sure Why you used loop to display your post meta. and you code are all ok but you have to change little-bit. Q. Why you used inline script ? On my opinion you should used external script file to do this. anyway that’s not the main issue here. In order to work with … Read more
I wouldn’t recommend writing PHP code in the content this way, e.g. for security reasons. Most likely the shortcode is using eval() and you need a valid PHP code snippet in each such call. The PHP documentation has this warning: Caution The eval() language construct is very dangerous because it allows execution of arbitrary PHP … Read more
You should look into creating a plugin for this and then inside of the plugin generating a shortcode for the output so you can place it almost anywhere you’d like inside wordpress. Having it has a plugin will give you the flexibility of quickly making changes and the future chance to apply it easily to … Read more
You can format it as, there’s also no need to put the echo <?php next_post_link(‘%link’,”<img src=”https://wordpress.stackexchange.com/questions/251458/. CFS()->get(“image_location’) . “/>”); ?> CFS()->get(‘image_location’) gets the field based on the current post id. If you want to use it for the next or previous, you have to pass the next or previous posts ID. You can do something … Read more
So in this case, the problem is that your line right before the echo call is incomplete: $number_rows= $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->daviddgl_wp1.SaveContactForm7_7” ); $x=1; while ($x<$number_rows) { $results = $wpdb->get_results(“SELECT ticket, name,email FROM $wpdb->daviddgl_wp1.SaveContactForm7_7 WHERE id = $x”); print_r($results); $x++; } (You’re missing the closing bracket and semi-column) Note also that your echo will … Read more
You may use $_GET parameter to get the id. $id = $_GET[‘id’]; Or try this: global $post; echo $post->ID; But it seems you have a problem in the args array. when you know the exact id of requested post you don’t need to use it like that. you can use this instead: get_post($id); And then … Read more