Can’t get post_updated hook to work

If it doesn’t work you can try to use a wp_insert_post action: function insert_post_hook($post_id, $post) { if ($post->post_date != $post->post_modified) { // This post is being updated! } else { // This post is being created! } } add_action( ‘wp_insert_post’, ‘insert_post_hook’, 10, 2 ); If you want to see the latest version you could enable … Read more

Keep highlight on menu item with post pages

Yes! Found a solution which is working fine for my case 🙂 if(window.location.href.indexOf(“/blog/”) > -1) { $(‘#menu-item-339’).addClass(‘current-menu-item’); } if(window.location.href.indexOf(“/articles/”) > -1) { $(‘#menu-item-241’).addClass(‘current-menu-item’); } if(window.location.href.indexOf(“/forum/”) > -1) { $(‘#menu-item-437’).addClass(‘current-menu-item’); } Solution found here

Point to a page when there is no results

Using “get_template_part()” has very specific formatting requirements. https://developer.wordpress.org/reference/functions/get_template_part/ To alter your example: get_template_part( ‘template-parts/content’, ‘page’ ); would work, if your .php file was located at “template-parts/content-page.php”

Adding post date to ACF field

You can use the get_the_time() to get the post time . <?php get_the_time( $format, $featured_post->ID ); ?> See the tutorial https://codex.wordpress.org/Function_Reference/get_the_time

display content in multiple columns

found a simple solution ..I m posting full index.php <?php /** * Description: Default Index template to display loop of blog posts * * @package WordPress * @subpackage BootstrapWP */ get_header(); ?> <?php // Some sample styles for the images echo “<style type=”text/css”> .half { width: 50%; float: left; } .ng-row { clear: both; } … Read more

Set multi posts random categories and tags

Oh, I made it myself. Just run this function until you satisfy function Trang_Mix_CatesTags() { $cats = get_categories(array( ‘hide_empty’ => false, )); $query = new WP_Query(‘post_type=post&posts_per_page=-1&post_status=publish’); if( $query->have_posts() ): while($query->have_posts()): $query->the_post(); $numbers = range(0, (count($cats)-1)); shuffle($numbers); $r = array_slice($numbers, 0, 5); $c = array( $cats[$r[0]]->term_id, $cats[$r[1]]->term_id, $cats[$r[2]]->term_id, $cats[$r[3]]->term_id, $cats[$r[4]]->term_id ); wp_set_post_categories( get_the_ID(), $c ); endwhile; … Read more

Display post in visual composer with custom html

You can create your own custom shortcode and then map it with vc_map(). You can read about it here: https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524332 . You can also modify already existing visual composer shortcodes https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524294 , but I didn’t tried that yet.