Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #882388

    Hi,

    i like to output the (hidden) headline on top if we select “General Layout” -> “Logo and Main Menu” -> “Sidebar left” but the Header-Settings are disabled and the code returns a false in the avia_title() function with no output.

    How can we activate the title again?
    The header-settings will be disabled. Ok, a headline at the content-topic seems not to be header settings.
    But how can we add titles with navigation and logo on the left side?

    We use a subtitle-extension which works fine with normal Enfold Header and Menu above-Settings.
    We add some format-settings within the “avf_title_args” filter which format the 2 titles like we need.

    Thank you!

    #882452

    Hey kisys,

    Please, could you share your WP credentials and the website link?

    Best regards,
    John Torvik

    #882707

    Yes & Thank you

    I solved it actualy injecting the main-title with the given hooks & filters:

    	/* Output Pagetitle with Parent, only if secondary-title plugin is active - else output title and parent */
    	add_filter('avf_title_args', 'custom_avf_title_args', 10, 2);
    	function custom_avf_title_args($args = '', $id = '' ) {
    		/* will be merged to avia_title args, see wp-content/themes/enfold/functions-enfold.php:427 */
    		global $post;
    		global $avia_config;
    
    		if ( empty($id) ) $id = avia_get_the_ID();
    
    		// print_r (get_option( 'active_plugins' ));
    		$pluginSecondaryTitle = 'secondary-title/secondary-title.php';
    
    		$parent = empty( $post->post_parent ) ? '' : get_the_title($post->post_parent);
    		if ( is_plugin_active($pluginSecondaryTitle) ) {
    			// $args['title'] = '<h1 class="my-main-page-title">' . get_the_title( $id ) . '</h1><h2 class="my-main-page-subtitle">' . get_secondary_title( $id ) . '</h2>';
    
    			$strSecTitle = get_secondary_title( $id );
    			if ( !empty($strSecTitle) )
    				if ( $strSecTitle == 'gallery' )
    					$args['title'] = '<h1 class="my-main-page-title my-main-page-title-only">' . get_secondary_title( $id ) . ' ' . get_the_title( $id ) . '</h1>';     // Only one line if secondary title like gallery
    				else
    					$args['title'] = '<h1 class="my-main-page-title">' . get_secondary_title( $id ) . '</h1><h2 class="my-main-page-subtitle">' . get_the_title( $id ) . '</h2>';
    			else
    				$args['title'] = '<h1 class="my-main-page-title">' . get_the_title( $id ) . '</h1>';
    
    			$args['link'] = '';
    			$args['heading'] = 'div';
    		}
    		else
    			$args['title'] = $parent . ' > ' . get_the_title($id);
    
    		return $args;
    	}
    	// remove_accents( 'ava_after_main_title' );
    	
    	
    	if ( !doing_filter('avf_title_args') ) {     // should check if avf_title_args filter is active to avoid double titles in top-navi-logo setting but don't work :-(
    		add_action( 'wp', 'custom_output_title' );
    		function custom_output_title() {
    			if ( ! (is_home() || is_front_page()) ) {	// only if page is not home
    				add_action( 'ava_after_main_title', 'custom_ava_after_main_title' );
    				// add_action( 'ava_after_main_title', 'custom_avf_title_args' );
    				function custom_ava_after_main_title() {
    					$args = custom_avf_title_args();
    					if ( ! empty( $args['title'] ) ) {
    						echo( '<div class="container"><div class="main-title entry-title">' . $args['title'] . '</div></div>' );
    					}
    				}
    			//}
    		}
    	}
    
    • This reply was modified 6 years, 12 months ago by kisys.
    #883739

    Hi,

    Glad that you figured it out. And thanks for sharing. You can also try the following filter to enable the title container if the sidebar header” is enabled.

    add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 9999, 1);
    function avf_header_setting_filter_mod($header) {
      $header['header_title_bar'] = 'title_bar';
    	return $header;
    }
    

    Best regards,
    Ismael

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