Custom theme conflicts with menu - php

I am trying to add a drop down menu on my Wordpress website. I have a custom theme made by somebody I can no longer get in contact with. When I make a Page a sub-unit in the Menu section of the Wordpress admin area, it doesn't make that page a drop down. Instead, it just makes that page appear under what is supposed to be the parent. Any help is much appreciated. Here is the code for my menu:
<div class="navigation">
<?php
wp_nav_menu(array( 'menu'=>'main-menu','items_wrap'=>'<ul class="menu">%3$s</ul>'));
?>
</div>

The way your menu will behave will depend on how the theme and wordpress installed is configured. You will have to analyze the template and understand what it is doing and how it is rendering your menu.
Most of the times, the menu is hardcoded in the "index.php" page that is in the folder: "wp-content\themes\themename\"
Check there how the menu is build.

Related

Left Sidebar on Wordpress won't create menu

I tried googling this, but not having much luck...
I have been able to create a menu using wordpress and entering this code in my header:
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
And this in my scripts part:
function register_custom_menu() {
register_nav_menu('header-menu',__( 'Header Menu' ));
}
add_action( 'init', 'register_custom_menu' );
But it seems that when trying to sort it, using the left side bar in the customize theme mode, it will not sort the menu nor will it remove any part of the menu that I add or remove using it.
From what I can tell it's just pulling my pages that I created within wordpress.
Keep in mind, this is a new theme I'm creating - my first theme. I have no PHP experience. Trying to learn as I go.
Picture of issue
I removed some of the names of the links for public view. I need to figure out how to also style this properly, but I've seen some other posts about it, so I'll review those later.
If someone can help me get this side menu to work with my current menu that would be great!
If you try altering your wp_nav_menu call to the following (no parameters):
<?php wp_nav_menu(); ?>
It should fall back on the first non-empty menu. While you may want additional menus later/will likely want to customize your menu(s) more, this should help with troubleshooting as whatever initial menu you have created (is non-empty) is the menu being edited by the customize page.
From what I can tell it's just pulling my pages that I created within
wordpress.
This likely relates to the setting "Automatically add new top-level pages to this menu" in the menu settings tab. This may be found under Appearance >> Menus, or under Customize >> Menus >> Clicking on the arrow to the right of your primary menu >> menu options (at the bottom of the resulting tab on the left).
Have you tried building the menu through Appearance-->Menu?
In the Wordpress backend, go to "Design > Menus", create a new menu there, add all entries you want to have, give it a name and in the "positions" tab on that page, assign it to the defined position in your theme (header-menu in your case). And disable the option to add all new pages/posts automatically.

Order Pages in Wordpress

I am new to CMS development, I prefer the MVC concept for every job. But just know the client requested to develop a website built in WordPress. Everything is OK but I can't find to order pages in WordPress.
The case is: first I create a home page and then I create other pages, but the problem is every time I add new pages, it will be placed in my first menu.
So I want to move the home pages in first menu.
Please help, thanks.
You can create a custom menu (with the pages/links you want, and the order you want !). Then you can add that menu to be the new navigation menu (both header, and footer if you want)
References:
WordPress Menu (here you can find the step by step 'guide')
Just go to Appearance --> Menus and then you'll be able to create menus and edit at will. And if you need to create specific menus, see WP nav menu page. There you'll see several code samples, but you'll need something as simple as
<?php wp_nav_menu( array('menu' => 'Main Nav' )); ?>

How to apply front page(customized) design to the entire RESPONSIVE template

I’ve installed responsive theme and responsive master child also.
I’ve designed a custom front page design and I want the same design on the entire website.
Here is the website:
http://fulnet.org/
and here is the website pages.
http://fulnet.org/what-we-do/
Basicly I want to modify the header menu area and the footer.
I dont want the sliders and the rest only the menu and the footer area.
PLease help me I’m new in working with wordpress and I’ve spent the last two weeks trying to made this changes, but not succeeded.
Thank you for your time and for help,
Ionut
If you want the header and footer to be accessible on all the pages, just include the wp_header & wp_footer on your pages files.
On the one hand, you have a static html page: http://fulnet.org/.
On the other, you have a Wordpress Theme: http://fulnet.org/what-we-do/
What you need to do is to make the neccessary changes in your style.css inside your Wordpress Theme - wp-content/themes/responsive.

Dropdown won't work in drupal

I'm redoing a website for a society at my Uni. Heres my progress: www.linclund.com/Newlund.com.
I'm very new to Drupal and Ckeditor and have done the majority of the work in CSS and html thus far.
My plan now is to get a decent dropdown menu, i installed the nice menu module and got it to be activated with all the scripts and styles, but it still won't respond as a dropdown.
This is what i'm looking at on the main page.php.
<?php if (isset($primary_links)) : ?>
<div class="pr-menu"><?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?></div>
<?php endif; ?>
Everything else seems to be normal, what do you have to do to get the dropdown functions of the menu activated? Could it be some script or style thats conflicting?
Edit the main menu links and set all links with children as expanded by default. Check the checkbox "Show as expanded" to enable this option.
But, the code you provide prints a specific menu (primary links) with a specific structure. You should better install the menu_block module and place the menu block under a region of your theme.
You need to set the nice menu block in a region. On nicemenu block's configuration page, you need to select the 'Menu' you want to use with nicemenu. Otherwise try supuerfish menu! I will offer what you want!

Programming custom PHP with Wordpress

I have a question regarding PHP and Wordpress.
I recently started using Wordpress for a simple website but there is still one thing that I just don't understand. Lets say I made a cool website in php that also cointains my header, my footer and my menu. How do I implement the Wordpress CMS so that someone else can add an item in the menubar that I made, instead of adding an item in a theme made by someone else? I have a hard time finding such tutorials because most of them are for people with no programming interests and because of that they don't explain such things.
If your only concern is how to connect your menu to the wordpress admin, you can check this link: wp_nav_menu()
that wordpress function will then generate a list of the menu items you add on the admin.
For example use this on your theme to display a menu from the admin with the name "Main Menu":
<div class="my-menu">
<?php wp_nav_menu(array('menu' => 'Main Menu' )); ?>
</div>

Categories