-
AuthorPosts
-
April 2, 2015 at 7:35 pm #422729
Hi,
How can I remove the title for custom post type without using css and editing the parent theme?
Couldn’t get the below working……add_filter('avf_title_args', 'hide_title_func', 10, 2); function hide_title_func($args,$id) { if(is_singular('_POST_TYPE_')){ $args['title'] = ""; $args['link'] = ""; $args['heading'] = 'span'; } return $args; }
April 3, 2015 at 6:29 pm #423218Hey senso!
Do you mind creating a temporary admin login and posting it here privately?
Regards,
YigitApril 3, 2015 at 6:33 pm #423219Hi senso!
That’s for the entry title that gets displayed with the breadcrumbs. You can find the default title around line 50 in /enfold/includes/helper-post-format.php.
/** * The avia_default_title_filter creates the default title for your posts. * This function is used by most post types */ if(!function_exists('avia_default_title_filter')) { function avia_default_title_filter($current_post) { if(!empty($current_post['title'])) { $heading = is_singular() ? "h1" : "h2"; $output = ""; //$output .= "<{$heading} class='post-title entry-title ". avia_offset_class('meta', false). "'>"; $output .= "<{$heading} class='post-title entry-title' ".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).">"; $output .= " <a href='".get_permalink()."' rel='bookmark' title='". __('Permanent Link:','avia_framework')." ".$current_post['title']."'>".$current_post['title']; $output .= " <span class='post-format-icon minor-meta'></span>"; $output .= " </a>"; $output .= "</{$heading}>"; $current_post['title'] = $output; } return $current_post; } }
Best regards,
ElliottApril 4, 2015 at 4:52 am #423345Hi Yigit,
Thanks for the prompt support. It is still offline..
Hi Elliott,
Sorry for not being clear. I meant the entry title next to the breadcrumb.And thanks for the heads up, needed to edit the default title too!
At the same time, can I check with the team how can I remove the preview image for the custom post types? The CSS trick hides all but would just like to remove for the cpt specifically.
Thanks all!
April 6, 2015 at 7:35 am #423814Hey!
This will remove the title of the custom post type “portfolio”:
add_filter('avf_title_args', 'hide_title_func', 10, 2); function hide_title_func($args,$id) { if(is_singular('portfolio')){ $args['title'] = ""; } return $args; }
Change the custom post type name in the is_single conditional function.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.