Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1468597
show year on blog date
Closed

Comments

  • carciofino started the conversation

    Hello

    Can you tell me please how we show the year on blog posts on the top level blog category page? 


    e.g http://misst.carciofinodev.co.uk/press/

    It seems to be unaffected by the options in Wordpress settings / general and can only see the option to hide the date in your theme settings but nowhere to choose to show the year.

    Thanks very much

    Joel

  •  7,092
    Oliver replied

    Hi, 

    Add this code to the functions.php of the child theme:

    remove_filter('vc_gitem_template_attribute_post_title_with_date', 'thegem_attribute_post_title_with_date', 10, 2);
    add_filter('vc_gitem_template_attribute_post_title_with_date', 'thegem_attribute_post_title_with_date_new', 10, 2);
    function thegem_attribute_post_title_with_date_new( $value, $data ) {
        extract( array_merge( array(
            'post' => null,
            'data' => ''
        ), $data ) );
        return '<div class="post-title"><h4 class="entry-title"><a href="'.esc_url(get_permalink()).'" rel="bookmark">'.mysql2date('d M Y', $post->post_date).': <span class="light">'. get_the_title($post->ID) .'</span></a></h4></div>';
    }
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver