How to get menu into inner pages of Divi

Ok, I used Divi to create my non profit medical site and while I get a good fullwidth menu on the home page following the layout given, I couldn't get the fullwidth menu to show up in categories and custom post types pages. How can I get the fullwidth menu to show up in categories and custom post types as shown in the screenshot?

    Barni

    @Ivan Denkov, thank you for the prompt response. The category/post page can be found here: http://deefrentng.com/thum-new/health-news and a single post is here: http://deefrentng.com/thum-new/can-eating-chocolate-prevent-cancer/

    The solution I'm looking for is to get the fullwidth menu used on the home page to be seen in all the categroy and if possible custom post types/buddypress pages.

    Regards

    Shoeb Ansari

    The main reason for posts and custom post type not showing the full header menu is, the divi page builder only apply to pages, not to posts and custom post types.
    I have found a solution from internet, which will allow you to use the page builder on the custom post types. For that you need to add some codes to the divi files.
    I dont have enough time right now to try that on my own, but you can take a back up and try this code on your site, or on some test site.

    Wherever you find this piece of code:
    
    in_array( $post->post_type, array( 'page', 'project' ) )
    
    replace it with:
    
    in_array( $post->post_type, apply_filters( 'et_pb_builder_post_types', array( 'page', 'project' ) ) )
    
    Now, create one new WordPress plugin, have it grab the et_pb_builder_post_types filter and add your post type there. Something like:
    /*
    Plugin Name: Enable ET Pagebuilder in custom post types
    Description: Enables Elegant Themes Pagebuilder in custom post types
    */
    
    class Enable_Pagebuilder_CPT {
    public function __construct()
    {
    add_action('init', array($this, 'init'));
    }
    public function init()
    {
    add_filter('et_pb_builder_post_types', array($this, 'et_pb_builder_post_types'));
    }
    public function et_pb_builder_post_types($post_types)
    {
    $post_types[] = 'YOUR_POST_TYPE_HERE';
    return $post_types;
    }
    }
    new Enable_Pagebuilder_CPT();

    This will allow you to use page builder on custom post type, with which you can add menu on required pages.

    Source

    Shoeb Ansari

    One big turn down to Divi is, their page builder is not working on posts, it only work on pages.
    Even after lot of requests from users, they haven't made it available to users, for some technical reason.

    Alternatively, you can edit the files with php code, which is responsible for single post, (single.php) and add the php code to display the menu.

    Your code for menu looks something like this in "inspect element".

    <div class="et_pb_fullwidth_menu et_pb_bg_layout_light et_pb_text_align_left" style="background-color: #ffffff;">
    			<div class="et_pb_row clearfix">
    				<nav id="top-menu-nav"><ul id="top-menu" class="nav"><li id="menu-item-55" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-55"><a href="http://deefrentng.com/thum-new/">Home</a></li>
    <li id="menu-item-3179" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3179"><a href="http://deefrentng.com/thum-new/cme/">CME</a></li>
    <li id="menu-item-62" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-34 current_page_item menu-item-62"><a href="http://deefrentng.com/thum-new/health-news/">Health News</a></li>
    <li id="menu-item-6171" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6171"><a href="http://deefrentng.com/thum-new/networking/">Networking</a></li>
    <li id="menu-item-3182" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3182"><a href="http://deefrentng.com/thum-new/webinar/">Webinar</a></li>
    </ul></nav>
    				<div id="et_mobile_nav_menu">
    					<a href="#" class="mobile_nav closed">
    						<span class="mobile_menu_bar"></span>
    					<ul id="mobile_menu" class="et_mobile_menu"><li id="menu-item-55" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-55 et_first_mobile_item"><a href="http://deefrentng.com/thum-new/">Home</a></li>
    <li id="menu-item-3179" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3179"><a href="http://deefrentng.com/thum-new/cme/">CME</a></li>
    <li id="menu-item-62" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-34 current_page_item menu-item-62"><a href="http://deefrentng.com/thum-new/health-news/">Health News</a></li>
    <li id="menu-item-6171" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-6171"><a href="http://deefrentng.com/thum-new/networking/">Networking</a></li>
    <li id="menu-item-3182" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3182"><a href="http://deefrentng.com/thum-new/webinar/">Webinar</a></li>
    </ul></a>
    				</div>
    			</div>
    		</div>

    This code is resolved version which gets displayed on the website.
    The developer here on WPMU can assist you with your require code (or the php code section which brings in the above mentioned html counterpart) by checking out your websites main pages.

    Hope it helps.

    Shoeb Ansari

    If the support staff here is not having any issues with that, then i can try to help you out with editing the theme files.

    But, for the security reasons of your website, i would suggest you to send the files to only WPMU staff members, as they are trusted ones.

    As i have shared the ways of correcting the issues, i am sure some staff will correct the code for you, if not, then feel free to send me the files and i will do it for you.

    (I am not sure if this would be, hijacking a thread for solution, thats why i am calling in wpmu staff first)
    If the staff permits here, you can send me the files at shoeb000(at)yahoo(dot)co(dot)in

    I would try to help you out with whatever i can do.
    Regards.

    Barni

    @Shoeb Ansari, thank you very much Shoeb, I taught you're a support staff not until when I look well! Ok, let me first consult and send the suggested solution you provided to a WPMU staff with admin and ftp logins and see what come out of it. Is it ok? If no WPMU staff attend not to the request, I will fall back you to help me out so that I won't get my ass fried!

    Now, I know that this is a top priority tweak because lack of fullwidth menu is also not present with BuddyPress pages once you are in the inner page of my Divi site and it make the site looks unprofessional! I'm optimistic that this core tweak will be solved.

    Thanks in anticipation. I revert back for any update.

    Kind Regards

    Ivan

    Hey Barni,

    Sorry for the delay, and thanks a lot @Shoeb Ansari for the solution - sending some reputation point on your way. You are awesome

    Can you please send you details from our secure form at https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me

    - Send an email using our secure contact form on https://premium.wpmudev.org/contact/
    - Select "I have a different question" from the dropdown
    - On the subject enter "Attn: Ivan Denkov".
    - Include the URL of this post in your message so that I may track this issue
    - Include a link to your website
    - Include admin credentials (username + password)
    - Include your FTP user/pass

    I will take a look at you post templates,please note that I will need to create a child theme for Divi, otherwise this changes will be lost on a theme update.

    Thanks,
    Ivan

    Ivan

    Hi @Barni,

    I think I managed to fix this for you. You should be able to use the page builder on post types and any other custom post type.

    Added the fallowing code in your child theme functions.php-

    function myprefix_et_pb_before_main_editor( $post ) {
        if (in_array( $post->post_type, array('page', 'project'))) return;
        if (!post_type_supports($post->post_type, 'editor')) { return; }
    
        $is_builder_used = 'on' === get_post_meta( $post->ID, '_et_pb_use_builder', true ) ? true : false;
    
        printf( '<a href="#" id="et_pb_toggle_builder" data-builder="%2$s" data-editor="%3$s" class="button button-primary button-large%5$s">%1$s</a><div id="et_pb_main_editor_wrap"%4$s>',
            ( $is_builder_used ? __( 'Use Default Editor', 'Divi' ) : __( 'Use Page Builder', 'Divi' ) ),
            __( 'Use Page Builder', 'Divi' ),
            __( 'Use Default Editor', 'Divi' ),
            ( $is_builder_used ? ' class="et_pb_hidden"' : '' ),
            ( $is_builder_used ? ' et_pb_builder_is_used' : '' )
        );
    }
    add_action( 'edit_form_after_title', 'myprefix_et_pb_before_main_editor' );
    
    function myprefix_et_pb_after_main_editor( $post ) {
        if (in_array( $post->post_type, array('page', 'project'))) return;
        if (!post_type_supports($post->post_type, 'editor')) { return; }
        ?>
        <p class="et_pb_page_settings" style="display: none;">
        <input type="hidden" id="et_pb_use_builder" name="et_pb_use_builder" value="" />
        <textarea id="et_pb_old_content" name="et_pb_old_content"></textarea>
        </p>
        </div>
        <?php
    }
    add_action( 'edit_form_after_editor', 'myprefix_et_pb_after_main_editor' );
    
    function myprefix_et_pb_builder_post_types($post_types) {
        foreach(get_post_types() as $pt) {
            if (!in_array($pt, $post_types) and post_type_supports($pt, 'editor')) {
                $post_types[] = $pt;
            }
        }
        return $post_types;
    }
    add_filter('et_pb_builder_post_types', 'myprefix_et_pb_builder_post_types');

    As long as the child theme is active you should be able to use the page builder.

    Test it and let me know if everything is as it should be.

    Thanks,
    Ivan

    Barni

    @Ivan Denkov, this is great! Thank you very much. I can see the Divi page builder in every of my post and cpt pages now.

    However, I have one more question as regards getting the Home fullwidth menu on inner pages. How can we place just the fullwidth menu module into posts and buddypress pages automatically in that when I'm making a new post or allowing Buddypress pages, I don't have to bother reconstructing the menu again nd ah! BuddyPress pages e.g Activity, Profile, Groups, Friends, Messages etc all ought to have a menu just as the home have a menu but they're not present. Hence, how can I get this solution to enable me put an end it? Peep http://deefrentng.com/thum-new/activity and http://deefrentng.com/thum-new/can-eating-chocolate-prevent-cancer/

    Thank you once again for this pro solution and in anticipation to my new request.

    Kind Regards

    Ivan

    Hi Barni,

    Sorry for the delay on this one.

    I was trying to find a way to integrate the Divi menu in the BuddyPress templates.

    Unfortunately the only thing I can come up with is to add the html from the generated menu in the BuddyPress templates in the child theme.

    But that is not good idea as you want be able to change them or do anything at all - the will be static menus standing in these templates.

    I wish I could come up with solution but this above me - maybe they can help you on Elegant Themes with this?

    I always can add the html menu to these templates if you want.

    Thanks,
    Ivan

    Barni

    @Ivan Denkov, sorry for responding late, I couldn't find snippet because it was on Divi theme user facebook page that he posted it. However, in the main time, what can we do?

    I am thinking of deactivating BP and use userpro to manage users and provide simple online community but add Chatpro (from WPMU) and bbpress into the mix to shoulder professional interaction for my site. What do you say?

    Ivan

    Hey Barni,

    Hope you are having a great day so far!

    The way Divi builder works is to add the menus to content of the posts/pages rather than in the header template. I wasn't able to find a way to get the menus in the BuddyPress templates.

    I am little confused in from your last paragraph - in the begining you say that you are going to deactivate BuddyPress, and in the end you are saying you re going to use it.
    Please advise.

    I haven't really used UserPro, but if you don't want to have integration problems you might want to consider using theme that is fallowing the WordPress coding standards. With Divi you will more likely to get a lot of problems integrating with other plugins. It is nice theme, but I will consider it more for a "Portfolio" sites.

    Thanks,
    Ivan

    Barni

    @Ivan Denkov, thanks for your candid reply. I appreciate the solution you rendered really, its cool and advance. It is not that I don't want to use BuddyPress but as it were after getting Divi Page Builder on posts and cpt pages, the buddypress pages wasn't affected and I was looking for a solution if it is possible to get just the Fullwidith Menu into its pages e.g activity, profile etc. Since there was no lead on that I taught of not using BuddyPress again since her pages will lack Divi Fullwidth Menu and this prompted to considered Userpro as an alternative. You can see my pain. Hope you could help.

    Kind Regards

    Ivan

    Hey Barni,

    I might not have been quite clear there, so sorry for the confusion.

    What I was trying to say is that for any page templates that are not edited in the backend adding the menu wouldn't be possible - for example the BuddyPress activity page.

    That will apply not only to the BuddyPress, but to every other plugin that uses templates to show some content - there is no possible way, at least for me to show the Divi menu in these pages.

    That's why I said I will consider it more for a "Portfolio" supposing people wont use BuddyPress and complex functionality/plugins on the site.

    My advise will be to choose another theme for this project.

    Thanks,
    Ivan

    Tyler Postle

    Hey Barni,

    Hope you're doing well today!

    I've been reading through this topic to try and get caught up. I can see you are using UserPro now, how do you like it?

    I don't see any CSS issues on your site at the moment. If you are still having any then just create a new post and we'll be there to help you out asap!

    All the best,
    Tyler

    PS. I also just posted back on the CSS issue you were having here: https://premium.wpmudev.org/forums/topic/styling-inner-widget-sidebar-pages?replies=6#post-794844

    jumapili

    well let me see if I can get help here because elegant themes support is wobbling my mind on this issue.
    The site : http://www.eegwash.org
    The problem is of course that on every thing other than "pages" the menu is does not display until scroll. That being said i have noticed that if you highlight the text with the mouse the menu is not there but no visible because the settings are for white text.

    My idea is that if I could just set the css for everything other than pages and home page to a the color like when you scroll down that would fix it, I am just not that good with css andy suggestions?

    Thank You
    Jumapili A.D. Ikuseghan