Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #222076

    Hello!
    I am customizing Enfold a little in my websıte. And instead of the line where you normally see the title of the page on the left and the breadcrumbs on the right, I would like to put a very simple custom menu, either via a widget or manually. The menu will be practically a submenu for the corresponding page.
    Probably there’s a php code somewhere, which could be replaced with a code allowing a widget area.
    Could you please help me further?
    Best,
    Nedim

    #222177

    Hi nedimhazar!

    Please add this on functions.php:

    add_filter('avf_title_args', 'avf_change_breadcrumb', 10, 2);
    function avf_change_breadcrumb($args,$id) {
    	if($args['breadcrumb'] == true) {
    		$args['breadcrumb'] = false;
    		$args['title'] = '';
    		$args['html'] = "<div class='{class} title_container'><div class='container'>PLACE THE MENU HERE</div></div>";
    	}
    	
    	return $args; 	
    }

    Add the menu inside the container div.

    Best regards,
    Ismael

    #222178

    Hi Ismael,
    thanks for the code. However, there’s one catch. the pages (three in all) have different submenus and naturally there is also the posts page. Meaning they have to be able to change. That’s why I thought a widget area might be more appropriate.
    Could you help me further?
    Best
    Nedim

    #222180

    Or the other way around, I would have to create a different page template for each one maybe?
    best
    nedim

    #222226

    Hi!

    I’m sorry but I think I need to ask the rest of the support team. Please wait for Dude’s response.

    Regards,
    Ismael

    #222592

    Hi!

    Adding a custom menu or widget area is not easily possible because it would require additional styling, additional php code, etc. and this customization is beyond the scope of our support forum. You can use Ismaels code above to change the breadcrumb and if you want to display different content on different pages use the is_page() conditional http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page
    to check the id of the current page – the code would look like:

    
    add_filter('avf_title_args', 'avf_change_breadcrumb', 10, 2);
    function avf_change_breadcrumb($args,$id) {
    	if($args['breadcrumb'] == true) {
    		$args['breadcrumb'] = false;
    		$args['title'] = '';
    		
    		$args['html'] = "<div class='{class} title_container'><div class='container'>PLACE THE DEFAULT MENU HERE</div></div>";
    		if(is_page(array(17,9))) $args['html'] = "<div class='{class} title_container'><div class='container'>PLACE THE MENU FOR PAGE 17 and 9 HERE</div></div>";
    	}
    	
    	return $args; 	
    }
    

    Best regards,
    Peter

    #222767

    Thanks Dude!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘how can I customize the title/breadcrum area?’ is closed to new replies.