Order Pages in Wordpress - php

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' )); ?>

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.

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>

Social Engine How to add or edit menu items

I am new to Social Engine. I am trying to add a custom menu item that will work with jQuery.
But I need to understand where is the file or files to edit in order to apply these changes.
Can anyone tell me how the Social Engine core is organized?
How do I find the files that control and generate the menu items?
Go to Control panel > Layouts > Menu editor and add new menu items to existing menus. From the same page you can also create new menus and later add them to any layout using the layout manager.
You should be able to add jQuery functionality to any menu by editing a suitable view file. Like if you want your jQuery to be available site wide then you can edit application\modules\Core\layouts\scripts\default.tpl and other layout scripts on that folder.
You can also create menu plugins. Take a look at this table on database- engine4_core_menuitems. You can see some menu items have corresponding classes. Find out those classes in SocialEngine and try to understand how they work. You can add conditions, small javascripts using these classes and this is recommended way to work with SocialEngine menus.
go to admin(control panel)
Layput
Menu Editior
As mentioned previously, we recommend editing menus in the Menu Editor which can be found in the Admin Panel > Layout > Menu Editor. For detailed instructions, please see: http://support.socialengine.com/questions/217/Admin-Panel-Layout-Menu-Editor
You can view the below mentioned video URL to understand the working environment with Socialengine Menu through admin user :
https://www.youtube.com/watch?v=Frc5U6iB_wg
need to click on Control panel then Layouts then Menu editor and add new menu items to existing menus. From the same page you can also create new menus and later add them to any layout using the layout manager.

Joomla menu system & dropdown menu in template

I am trying to make a simple drop down menu system for my Joomla site. But Joomla menu is completely confusing me. How does a joomla menu work?
For eg: In the image below the whole blue bar is a menu? or each item like 'Projects' is a menu?
Now I can make two pages for Project 1 & Project 2 but where will the 'Projects' link point to? If it does point somewhere then incase of no JavaScript I'd like to point it to a page that shows a list of the menu items.
How do I place my menu at this place in my template?
Why is there a default MainMenu and why do I need to use a menu to show the main content on my site. Shouldn't menus be used for making menus. And I only needed a menu item to show my content not that whole Main Menu. The main confusion is the Main Menu.
I don't wanna use a module coz I couldn't find a good one for 1.7 that uses jQuery (All JavaScript on my site is done with jQuery) and I read somewhere it can be made within the template.
All I want is to somehow place menu items lists inside the respective anchors up top so I can just show/hide them as dropdowns with jQuery.
I hope I haven't made the question confusing pointing to what I need to make. It's just that I'm super confused myself.
Please help.
I appreciate the help.
Thanks Alot.
Joomla menus are generated thru modules. In most cases mod_mainmenu. Theese modules you place in module positions. If your menue should be horizontal on top, then you put your mod_mainmenu module in the position "top". Be aware that every template uses different position names.

how to make drupal pages into menus and submenus like administrator menu

I'am new to Drupal, i just want to create a website which contains pages like about us, contact us and other static information that may be changed after a long time.
Now i can create the pages and sub pages to main pages. The links are displaying on the top of the logo and the sub pages were showing on the side of the main page.
i installed the dhtml_menu module but not working.
are there any changes required to dhtml_menu module to make work for pages?
or
i need to use any other module?
please help me to solve this issue
Thanks.
Your question is pretty confusing. If you just want to display the pages in a tree just like the administration menu (which seems to be what you're asking), then you don't need any extra modules.
Just create your pages and put them all in the primary menu. Then, once your pages are created add the Primary links block (in Administer, Blocks) anywhere you want. That block will display the navigation tree of your pages, just like the administrator menu does.
edit
Oh, so you want the drop down menus? Then you don't want dhtml_menu (which will only prevent unneccessary page loading when you open pages), but need something like simplemenu. Create your primary links, goto Administer, Site Configuration, SimpleMenu and set the "Menu" setting to "< Primary links >". That will display a drop down menu bar to navigate through your site...
First i need to say thanks to wimvds. "Thankyou wimvds for your edit it take me to find more modules and themes".
found the solution in a theme "admire_grunge" the drop down menu needs to be defined in the themes it self.
found some more themes that work like this.
Thanks.

Categories