- This topic has 21 replies, 4 voices, and was last updated 7 years, 8 months ago by
Leo.
-
AuthorPosts
-
July 13, 2018 at 9:28 am #622991
Leo
StaffCustomer SupportUsing 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?
July 14, 2018 at 12:12 am #623373Ruben
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; }July 14, 2018 at 9:34 am #623639Leo
StaffCustomer SupportTry 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; }July 16, 2018 at 1:48 am #624614Ruben
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
July 16, 2018 at 8:30 am #624922Leo
StaffCustomer SupportCan you try the edited snippet above?
https://generatepress.com/forums/topic/remove-post-date/page/2/#post-623639July 17, 2018 at 1:39 pm #626066Ruben
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
July 17, 2018 at 2:47 pm #626111Leo
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.