Showing a link with Javascript based on log-in status

It is string escape problem with PHP Syntax Correct Code: <?php if ( is_user_logged_in() ) { echo ”; } else { echo ‘<a onclick=”ppOpen(\’#login_panel\’, \’800\’,1)” href=”https://wordpress.stackexchange.com/questions/155957/javascript:void(0)”>Entrar</a>’; } ?>

Give a condition to a wordpress menu item to change its offerid for each landing page I create

What about using jQuery to insert the unique code to your CTA menu class or item ID? Something like: // generate your unique codes in jQuery var mycode = your_random_code_function() // or an array of codes // then… var myhref = $(“body.landingpage .navbar-nav .cta a”).attr(“href”); $(“body.landingpage .navbar-nav .cta a”).attr(“href”, myhref + “?offerid=” + mycode); // … Read more

Is It Possible To A Link To The Homepage From The Admin Sidebar?

The $location parameter was incorrect. Try this: function redirect_to_local_110(){ wp_redirect( home_url() ); exit; } function add_home_link() { add_menu_page( ‘Course’, ‘Course’, ‘read’, ‘home’, ‘redirect_to_local_110’, ‘dashicons-welcome-learn-more’); } add_action( ‘admin_menu’, ‘add_home_link’, 1001 ); Or you could use this: function redirect_to_local_110(){ wp_redirect( ‘http://www.example.com’, 301 ); exit; } function add_home_link() { add_menu_page( ‘Course’, ‘Course’, ‘read’, ‘home’, ‘redirect_to_local_110’, ‘dashicons-welcome-learn-more’); } add_action( … Read more

Add a Submenu from Another Submenu in a Custom Theme

It seems that you are adding the menu levels as separate menus: A “Primary menu” containing the items: “HOME”, “DPRK TOURS”, “INTERNATIONAL”, … etc. A “Secondary menu” containing the items: “INTERNATIONAL GROUP TOURS”, “VOLUNTEER PROGRAMS”, … etc. However, most themes support at most two such menu-levels, and some even support only one. So, if you … Read more

How do I remove a menu from a theme?

In your admin panel, go to Appearance > Menus > Manage Locations There you make sure that none of the theme locations have a menu assigned. Alternatively, you can modify your theme. If you want to do that, search for calls to wp_nav_menu. If you take theme twentyfourteen, you have 2 files: header.php and sidebar.php … Read more

jQuery not working when used with wordpress menu

You are missing <script> tags You are using the wrong jQuery variable name. If you want to use the $ alias you need to use noConflict as helgatheviking suggested or switch to “jQuery” instead of $ You are missing }); at the end of the code you posted above You should consider separating your JS … Read more

Add different span class to wp nav menu

If you want to add different classes to each menu, you can do that by JS. In JS just add a array, where you should save corresponding menu and it’s class. and run a each loop to add classes to menu.

Active menu item / category

Alas, this is a CSS issue, caused by some difference in WP’s classes applied. 🙂 First you are misinterpreting your “test” case 2: Dropdown isn’t highlighted because (despite what post body says) it’s not actually assigned the subcategory. The styling applied is from .current-menu-parent, since post is obviously not a term in taxonomy. In your … Read more

How can I make this custom design menu work in wordpress?

The problem is in your sub-labels below the main text in each item. When building menu, set a custom name to menu item with like this: World News From Around The Globe Another method is to use a megamenu WordPress plugin, which supports two labels.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)