SientjeD
asked 8 years ago

I’ve tried many css entries in the menu structure box, but no luck yet…

3 Answers
DominicStaff
answered 8 years ago

Hi Sientje,
To hide a page from the menu and leave the page visible when scrolling on the DW Page, please follow my instruction here:
Step1: open the framework.php file in the folder path “wp-content\themes\dw-page-modern\inc”
Step2: Find the line from 307 to 327 then replace the following code:

  foreach ($menu as $menu_item) {
            $active = $i == 0 ? 'class="active"' : '';
            $menu_id = sanitize_title($menu_item->title);
?>
            <li <?php echo $active ?>>
                <a href="#<?php echo $menu_id ?>">
            <?php echo $menu_item->title  ?>
                </a>
            </li>
<?php
            $i++;
        }
?>               
        </ul>
    </div>
<?php           
        }
    }
}

With the new code:

  foreach ($menu as $menu_item) {
            $active = $i == 0 ? 'class="active"' : '';
            $menu_id = sanitize_title($menu_item->title);

            if ($menu_item->menu_item_parent == 0) :
?>
            <li <?php echo $active ?>>
                <a href="#<?php echo $menu_id ?>">
            <?php echo $menu_item->title  ?>
                </a>
            </li>
<?php
            endif;
            $i++;
        }
?>               
        </ul>
    </div>
<?php           
        }
    }
}

See the screenshot:

Step3: Log in to Dashboard > Appearance > Menu then move the menu that you want to hide.
Example:
 

  • Portfolio
        – Team

 

See the screenshot:

Hope this helps!

Doug Bloom
replied 8 years ago

Excellent Information.
Is there a way to not have the parent menu text highlight when scrolling through these sections?

Dominic Staff
replied 8 years ago

To resolve this issue. Please add the following code to the style.css file

.navbar .nav > li > a, .navbar .nav > li > a:active, .navbar .nav > li > a:focus {
color: #000;
}

Juan Rodriguez
replied 8 years ago

but what if its the first page in the menu you want to hide?

Dominic Staff
replied 8 years ago

you can add the following code to the Header Code (Dashboard > Customize > Custom Code)

Regards,

SientjeD
answered 8 years ago

It works, woordatelier.nl. The only thing is when using links with anchors, the title isn’t visible. Can i use code in a title? But thank you for your theme en time!

DominicStaff
answered 8 years ago

Currently, Our DW Page does not yet support use code in a title.

Powered by DW Question & Answer Pro