How do I remove the date and category form my portfolio pages

This is one of my portfolio page http://185.105.4.132/~orangeye/portfolio-item/media-central/

Whenever I wanted to remove dates and category from blog posts I always used this code

function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
add_filter('the_category', '__return_false');
add_filter('get_the_date', '__return_false');
add_filter('get_the_time', '__return_false');
add_filter('get_the_modified_date', '__return_false');
add_filter('get_the_category', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');

Since, in this case they are portfolio, I replaced posts with portofolio. But no luck. Please help me.thanks.

Are you wanting amend your PHP files to achieve this? I only ask, as the code there looks to be JavaScript, and you may be asking the question in the wrong forum.

Oh no no. I am really sorry.

I selected the wrong tag.

Apologies.

All done :slight_smile:

1 Like

can you please help me resolving the issue as well. thanks again.

Assuming that you’re refering to the date I’ve highlighted in the image below, then that has a class or “edgtf-portfolio-date” on it which you could target.

I’m very puzzled why you’d use JavaScript to remove content that has been generated by Wordpress (?). It seems to make more sense to find out where the dates is coming from - a template perhaps - and remove, or comment out, the code that’s producing it.

1 Like

Yes, we both are talking abou the same date.

Well, I wasn’t able to find the template which is responsible for this. So, then I thought I will do it using JS.

if you can please help me with the code, it would very nice. thanks again.

Actually this is a WordPress site and add_filter() is a WordPress function. You might get more response from the WordPress forums.

Another move then?

the only another move I have is to use some JS code.

But, not sure what ?

Could you please post the code where you replaced posts with portfolio?

If you are using a purchased theme and want to alter the php code, you should probably contact the theme developer for help also.

But the easiest solution would probably be what @chrisofarabia suggested - just comment out the php code that is producing the date (or maybe use css display:none on the targeted element). However, don’t do that in the original theme - you really should make a child theme for that. If you adjust the code in a theme, any subsequent updates will overwrite your changes and you will have to start all over again.

I was just poking round in a vanilla install of WP and found this setting with the widgets - would that help? It looks like you can untick it and the dates disappear from blog posts.

Edit: Having tried that out, that looks to edit a date in a ‘Recent Posts’ list, rather than the blog post itself. It might be worth noting that I know very little about WP itself, so am just poking around to see what might be relevant.

1 Like

yes I have contacted the theme developer many times now, but haven’t responded back.

the code I used is

function jl_remove_portfolio_dates() { add_filter('the_date', '__return_false'); add_filter('the_time', '__return_false'); add_filter('the_modified_date', '__return_false'); add_filter('the_category', '__return_false'); add_filter('get_the_date', '__return_false'); add_filter('get_the_time', '__return_false'); add_filter('get_the_modified_date', '__return_false'); add_filter('get_the_category', '__return_false'); } add_action('loop_start', 'jl_remove_portfolio_dates');

thanks for this.

But, we are not implementing this through widgets.

We are using built-in theme features to create portfolios.

I got resolved.

just used some css and solved the issue. Thanks everyone.

this is what I did .edgtf-portfolio-single-holder .edgtf-portfolio-info-item {display:none;}

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.