[Resolved] Remove Post Date

Home Forums Support [Resolved] Remove Post Date

Home Forums Support Remove Post Date

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #622991
    Leo
    Staff
    Customer Support

    Using the CSS solution would only prevent the date to show up on the front end.

    This is where we would need to use the filter I suggested above.

    Are there any categories you would like the date to show?

    #623373
    Ruben

    For example, the category “comparativa-brokers” should be displaying dates and other data. You can see the links to the images of one post here and here.

    As you can see I have all options on in the customizer, however the post does not show anything.

    What could be happening there?

    ———

    As for the filter to remove the date showing in the back end, I do not know but maybe something like this should work?

    add_filter( 'option_generate_remove_date', 'remove_date_from_category' );
    function remove_date_from_category( $options ) {
        if ( categoryx() ) {
            $options['date'] = false;
        }
      
        return $options;
    }
    #623639
    Leo
    Staff
    Customer Support

    Try this:

    add_filter( 'option_generate_blog_settings', 'lh_category_date_settings' );
    function lh_category_date_settings( $options ) {
        if ( in_category( array( 'category1' , 'category2' , 'category3' ) ) ) {
    	    $options['date'] = false;
    
        }
      
        return $options;
    }
    add_filter( 'option_generate_blog_settings', 'lh_category_single_date_settings' );
    function lh_category_single_date_settings( $options ) {
        if ( in_category( array( 'category1' , 'category2' , 'category3' ) ) ) {
    	    $options['single_date'] = false;
    
        }
      
        return $options;
    }
    #624614
    Ruben

    Hi

    I tried it with one category, but the published date is still beign shown in the source:

    <header class="entry-header">
    			<h1 class="entry-title" itemprop="headline">Revisión de ApexFutures</h1>			<div class="entry-meta">
    				<span class="posted-on"><a href="http://www.mejorbrokerdebolsa.com/revision-de-apexfutures/" title="12:03" rel="bookmark"><time class="updated" datetime="2016-09-05T13:11:17+00:00" itemprop="dateModified">5 septiembre, 2016</time><time class="entry-date published" datetime="2015-04-16T12:03:36+00:00" itemprop="datePublished">16 abril, 2015</time></a></span>			</div><!-- .entry-meta -->
    				</header><!-- .entry-header -->

    I will open a new thread with the other thing I asked you about the blog options in the customizer.

    Thx

    #624922
    Leo
    Staff
    Customer Support
    #626066
    Ruben

    Now, with the edited code the date is removed from the view-source as well.

    Using the plugin “code snipets” by the way

    Thank you

    #626111
    Leo
    Staff
    Customer Support
Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.