Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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;
    }
    #423218

    Hey senso!

    Do you mind creating a temporary admin login and posting it here privately?

    Regards,
    Yigit

    #423219

    Hi 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,
    Elliott

    #423345

    Hi 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!

    #423814

    Hey!

    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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.