All Questions
866 questions
0
votes
0
answers
29
views
PHP - Change Text Field to DropDown Menu and precompoiled Text Field [closed]
i'm working on a theme for vacation rentals in Wordpress and in a page, the owner have a text box in which he can write down any cancellation terms and policy. It's a simple text box.
I want to change ...
1
vote
1
answer
61
views
WordPress Menu is expecting wp post element
Trying to add a Page Element to a Menu results that WordPress is hanging - in the debug.log I see an error similar like it is expecting a WP_Post Element (which makes no sense in this case here). How ...
-2
votes
1
answer
105
views
how to add a class to one button inside a menu based on php foreach? [closed]
i have a video site like youtube .
admin can add many categories with no limit .
these categories display on top of the site as a horizontal menu .
this is the code that display the categories :
<?...
1
vote
2
answers
68
views
Show 5 latest posts in Wordpress footer menu under the third menu item
I want to add a custom code under the third menu item in my Wordpress footer menu. It's meant to show the latest blogpost under the "Blog" (in this case "Insights") menu-item. I ...
0
votes
0
answers
39
views
Switch language menu Codeigniter 4
I am a beginner in codeigniter, I am using version 4 to create a multilingual application, I have applied all the steps but it cannot work correctly. Manually it works, i.e., by typing the link ...
0
votes
0
answers
19
views
Hide a nav menu item if a user hasn't purchased a specific product in WooCommerce and PHP
I am trying to write a PHP code that will hide an existing nav menu item called 'My English Course' if a logged in customer HAS NOT purchased a WooCommerce product with an ID of 426.
In other words, ...
0
votes
1
answer
45
views
Wordpress anchor menu buggy
I have built my own portfolio website in Wordpress Elementor Pro, and on the portfolio page I have an anchor menu with all my categories of items, like "Logotyper" = Logotypes, "...
0
votes
1
answer
43
views
Split wordpress bootstrap4 navwalker header menu into two lines on smaller screens only
This WordPress website uses Bootstrap 4 and a version of Navwalker.
My client only views her website from her iPhone, and she doesn't want the menu to collapse. So, for her to see the entire menu ...
0
votes
0
answers
39
views
How to Remove Parent Page Link from WordPress Submenus with Three or More Nested Levels?
I'm encountering an issue with WordPress menus where if there are three or more nested submenus, WordPress automatically includes the parent page link followed by the submenu link.
For example, in ...
0
votes
1
answer
40
views
How to create lists template enfold?
I am using wordpress to create the website, I have two problems, the
First: I cannot create menus"can't customize drop down menu", after saving the menu it disappears.
Second: I can't add an ...
0
votes
3
answers
122
views
how to restrict a menu for some userd based on the value of a specific field?
On my primary wp nav, I have a menu item named 'Research' which i want to only be shown for Researchers in wordpress.
Researchers will be defined by a user meta field called wpum_relationship_to_lib ...
0
votes
0
answers
122
views
Why does my mobile WordPress menu display on the admin panel but not the site?
The mobile menu is displayed in the backend but not in the frontend.
The theme is: Bootscore
I added the following code to my functions.php to register the mobile menu:
function ...
0
votes
0
answers
353
views
Update Dependent Dropdown Menu PHP, Jquery, Ajax
Goals2 Table:
id
game_number_id
team_id_goal
player_id_goal
1
1
1
1
2
1
1
2
3
1
2
3
Teams Table:
id
name
1
MTL
2
BOS
3
CGY
4
EDM
Players table:
id
team_id
first_name
last_name
1
1
Kirby
...
1
vote
1
answer
183
views
How to Change WordPress Menu Structure (ul > li to nav > a)
I'm trying to create a WordPress menu using:
<?php
wp_nav_menu(
array(
'menu' => 'Top Mid',
'container' => 'nav',
...
1
vote
0
answers
52
views
How do I speed up a large website category navigation?
I have a category menu on a website that goes about four levels deep. There are a few thousand links included. My current implementation simply loops through each level to add top-level items and then ...
0
votes
0
answers
50
views
Wordpress: Change menu based on JavaScript variable
My current problem is ti change the menu being loaded in my header-top-area.php file based on the value of a javascript variable I've created.
So far, I've written a simple script that identifies the ...
0
votes
2
answers
68
views
Where/how to edit mobile menu on custom-coded site
I am looking to update a link in the mobile hamburger menu on a custom-coded website that uses custom fields. I want a menu item to link to a pdf instead of a #section (one-page site).
I have scoured ...
0
votes
0
answers
193
views
Wordpress plugin admin settings page
I'm working on a very simple plugin for wordpress. I'm dealing with "admin settings page".
I'd like to keep things separated in php files, as most tutorials do, but something broke in my ...
-1
votes
2
answers
2k
views
Why is both mobile and desktop nav menu showing on WordPress site?
Working on a WP site (site link) with Elementor Pro, my problem is that while editing the page and the site, the header looks fine, but on the live site both the mobile and desktop nav menu is showing ...
0
votes
1
answer
2k
views
Wordpress - How to add condition "if user logged in" for html/css/js menu
I'm working with elementor, in the html widget I wrote some code to create a menu and it works fine. Now I want to hide a part of the menu to make it visible only to logged in users. I understand that ...
2
votes
0
answers
353
views
How to auto Generate Menus If a module is installed in Laravel
Here's my goal.
I'm Creating a laravel application and I split different functions in modules using NWIDART module.
On my side menu I used pre defined code to check if module exists and if module ...
-2
votes
1
answer
109
views
How to create url form in menu dynamic laravel
I just want to know how create condition in laravel if url field / form in menus is true then in menu href will linked into $url, unless if url form is null, then in menu href will linked into $id ...
0
votes
2
answers
1k
views
PHP include for header menu footer works on index.php but not other pages
I have tried substituting my html code for include PHP references. It works on the index.php but the three includes, header menu and footer do not appear on the other pages, though the content and ...
0
votes
1
answer
24
views
"Notice: Trying to get property" for nested menu [duplicate]
cID
cPID
cSlug
cName
1
0
hello
H1
2
0
world
WORLD
3
0
mars
MARS
4
1
people
People
5
1
dogs
Dogs
6
3
cats
Cats:)
cPID: Parent ID
PHP:
$getMenuData = $db->table($vtCategories)->getAll();
$...
-1
votes
1
answer
119
views
Css multilevel vertical menu with Php Mysql
I have the following code for integrating a categories menu with unlimited multi levels
<ul id="menu_mb_ul" class="nt_mb_menu">
<li class="menu-item menu-item-has-children ...
0
votes
2
answers
542
views
how to category list? [PHP accordion]
I need to create unlimited categories, and ı use php + mysql.
My database struct.
id
name
parent_id
1
Electronic
0
2
Laptop
1
3
Desktop
1
4
Car
0
5
Renault
4
6
Megane
5
the look i want to ...
0
votes
0
answers
58
views
Add a <div> after <li> in wordpress [duplicate]
I use this script to show the wordpress menu
<?php
$argsM = array(
'theme_location' => 'menu-principal',
'items_wrap' => '<ul class="sf-menu nav navbar-nav %2$s&...
0
votes
1
answer
659
views
Hide/Show menus when logged in/out on WordPress
My website is built with WordPress and I currently have 3 nav menus
The main menu - "Main"
A secondary top menu - "Player Logged-in"
Another secondary top menu - "Player ...
1
vote
0
answers
97
views
Get subcategories of subcategories
I have my own menu structure in the template. The code below works fine. Here I get the parent category and all the subcategories of that parent category. The problem is that now I need to output ...
-1
votes
1
answer
531
views
Add item to "Add menu items" section in wordpress
I am developing a wordpress theme. In the "Menus" there is a section:
How can I add an item to this programmatically? is it possible?
Update:
If that is not possible, how can I add "...
2
votes
0
answers
22
views
How to create and customize a menu in word press 5.8 by coding
I'm new to word press. For creating a new menu, I'm using register_nav_menus()
function inside functions.php to register a menu. But I still need word press admin panel to add items in a menu e.g ...
0
votes
2
answers
227
views
highlight a wordpress nav link for a single page
I have an archive events page that links to a single page that lists all previous events created in the past and can only be visited via the archive events page.
My question is, how can I highlight ...
0
votes
1
answer
156
views
New Registered Menu Not Displaying WordPress
Registered the menu in functions.php
Selected the menu in WordPress dashboard
Added wp_nav_menu to the page
However it displays the desktop-menu not sidebar-nav.
I have no plugins running
functions....
0
votes
1
answer
218
views
my Css code for navigation menu not working in Wordpress theme
while making my custom navigation menus for my own Worpress theme, navigation menu's css code's some codes are working, some are not working while entering php navigation code for Wordpress theme.
...
-2
votes
1
answer
289
views
Bootstrap Toggle Burger Menu not working when switched to mobile view
<nav class="navbar navbar-expand-lg navbar-dark px-2 " style="background-color:#E53935;">
<a class="navbar-brand" href="#">HeadOverMeals&...
0
votes
1
answer
233
views
Yii2 AdminLTE: how to load left.php file?
I am using yiisoft/yii2-app-basic with dmstr/yii2-adminlte-asset but I can't load the left.php file (it has the left menu).
I want to change the left menu (left.php file) and I found this in the ...
0
votes
1
answer
123
views
How do I pull variables from my Database?
I have a menu of Home About Blog Templates Contact.
There is a table in my database called Categories.
The items in my table are Home About Blog Templates Contact.
These five items are being pulled ...
0
votes
1
answer
3k
views
Add top level menu item title to start_lvl in Wordpress menu walker
I've created a custom WordPress menu using the WordPress walker function. I've managed to do all the necessary HTML I need except adding the top-level menu title to just after one of the divs in the &...
0
votes
0
answers
166
views
Close mobile menu after link click
I have a mobile menu that does not close after clicking a menu link because the menu links are anchor points on the same page.
I'm trying to make it so clicking a mobile menu link activates the "...
1
vote
0
answers
1k
views
Wordpress global $menu not showing all menu items in a custom plugin
I have created a php function which changes some wp admin menu item names. When I added this code to the function.php of my custom theme it works perfectly. But when I added the same code to a custom ...
-1
votes
1
answer
140
views
Dynamic menu via PHP
The code below generates a menu with UL and LI correctly, but I needed to add other information to make the code a little different.
<?php
$items = array ( 1 => array ( 'parent' => '0', '...
-1
votes
2
answers
378
views
How can I share a non-primary menu of a Multisite's main domain across all sub-domains in the form of tabs as links?
I have a Multisite with a main domain (www.valleysgroup.co.uk) and various sub-domains (brickslipsdirect.valleysgroup.co.uk, tradeporcelain.valleysgroup.co.uk etc).
I am wanting to share a custom top ...
1
vote
2
answers
2k
views
Hide WooCommerce empty product categories from WordPress menu
Based on Sort WooCommerce product category sub menu items by name ASC in Wordpress menu answer code to my previous question, I am able to automatically display child subcategories as menu sub items ...
0
votes
1
answer
321
views
wp_nav_menu Returning nothing
So I have come to move my HTML site over to wordpress and im having issues with the menu. None of the links listed in the admin panel pull through.
header.php code:
<nav>
<?php
wp_nav_menu(...
0
votes
1
answer
410
views
Add a second line to main menu on Divi
I'm trying to create a 2nd line above the top main menu on WordPress Divi. I created the variable $secondaryNav to hold the 2nd line. I'm trying to replicate the menu from this page as an example: ...
0
votes
1
answer
201
views
How to add classes to wp custom nav <li> and <a> elements
I have custom nav, i did put custom classes on nav ul element, but i cant put on li and a elements. There is my code
functions.php:
function wpb_custom_new_menu() {
register_nav_menu('...
0
votes
1
answer
71
views
how to give my WordPress menu page custom link
I have created a menu page using add_menu_page() and now page link is admin.php?page=xxxx
,but I am using this page to show notifications using add_action('admin_notices', 'any_name'); and in this ...
1
vote
1
answer
623
views
How to add classes to Wordpress navigation menu items based on custom advanced menu options
I found this code which has allowed me to add custom fields to the advanced options in the Wordpress menu editor:
/*
* Saves new field to postmeta for navigation
*/
add_action('...
0
votes
2
answers
69
views
Menu active item with PHP
I am trying to make menu with active class for every site.
And I don't know what I am doing wrong. Thnaks for help :D
<li class="nav-item <?php echo $home; ?>">
<a class="...
0
votes
3
answers
209
views
Show category in menu blade laravel 7
I'm trying to show the categories in a drop down menu, but I'm having some trouble in the blade. The categories don't show, but I'm not getting an error.
This is my blade:
<li class="nav-item ...