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>';
}
?>
Related Posts:
- Add Javascript to WordPress Menu
- Adding a class (arrows) to main menu links that have children?
- Merge two separate WP menus into one in Mobile view
- I am facing a problem with the navigation menu of my website
- WordPress menu link not working
- Static page to one page- menu inactive items highlighted
- Add code to WordPress menu items by class
- Twenty Fifteen: Change navigation menu behavior
- Event listener callback returns undefined element
- Mobile navigation javascript problem
- Cannot collapse a responsive menu in WordPress
- Change hover to onclick on menu
- Add “onclick” option to header menu item
- Homepage Menu Link Won’t Function
- How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme
- calling JS to custom menu design
- javascript i wrote not working, can’t figure out why [closed]
- How can I make menu items into two seperate buttons with different functions?
- Menu Details Output in Javascript [closed]
- How do i keep my current page menu highlighted on pagination?
- Jquery dropdown menus working locally, but not in WordPress [duplicate]
- Changing when mobile menu is displayed
- How can I only show one responsive menu on mobile devices?
- Active Navigation Class Based on URL on icon
- how to create a menu with all sub categories?
- How to avoid wp_nav_menu() ID conflict?
- Remove unusable metaboxes in nav menu management screen
- Highlight parent menu item when child is not in menu
- Add custom attribute to menu item link using Filter
- Creating new dynamic menu including BP links [closed]
- Building a Sub-menu: Display Parent Category/Page’s Children When Viewing Children
- List parent item with all child item on child pages
- Output the aria-labelledby parameter for a nav menu child
- Hide menu items for visitors and filter based on role
- Add a “has-children” class to body tag?
- Custom Nav Walker sub-menu HTML construct
- How to remove trailing tags from wp_nav_menu walker
- Custom Walker for Walker_Nav_Menu
- How to scroll item in the Menu setting effectively?
- Building custom API and using wp_get_nav_menu_items to get menu items. Only works when logged in, returns nothing when I’m not
- Appearance -> Menu -> Menu Structure : Add plain HTML code as an element
- Replace menu permalink/hyperlink with only menu name/slug
- wp_nav_menu add some element to container
- get_search_form() doesn’t appear to take parameter into account
- Custom menu deletes itself
- show different admin menu to different user roles
- How to include a third level with wp_get_nav_menu_items function
- Schedule Page to Menu [duplicate]
- Bulk Custom Menu and Wp-Ecommerce
- Show Menu from one WordPress install in another WordPress install
- Check if Page Already Exists in Menu
- Reuse a custom WordPress menu on another WordPress website
- How to dynamically populate a dropdown
- Default WordPress menu content
- how do i change the text under a navigation menu [closed]
- How do you add a around the second level of a Menu?
- Remove admin menu
- Limit User Iinterface for Admin?
- Creating menu and breadcrumb “sections” within WordPress 3 being used as a CMS
- Hide menu from homepage
- WordPress Nav Walker – Top menu link with dropdown link not clickable (dropdown opens)
- Menu Not Showing on Mobile
- Add custom class to li element which has children
- How to Show Different Menus to Logged in Users in WordPress [duplicate]
- Unable to get menu pattern using a walker
- Menu not adding the right items
- get only the item you click on
- Output Post ID for all nav_items
- How can I add a class to a nav menu when I’m viewing a child page?
- wp_nav_menu inside an object — how do I deal with fallback_cb?
- Splitting up a submenu into columns, or putting existing menus in another menu as submenu item
- wp_nav_menu does not take arguments?
- Walker_Nav_Menu creating too many closing tags?
- Can’t insert internal links and menu errors appearing
- horizontal menu / 4-level depth
- Theme Menu vs Native Menu
- Custom menu including also primary menu items
- open menu link (PDF) in new tab not download
- twentysixteen child theme – responsive menu – ham icon button not working – Cannot read property ‘classList’ of null
- How to add Loginout to Sub-menu
- having a page in multi sub-menu and match current-menu-item
- PHP Warning adding menu
- Customize version different to Live version
- Sub-Items Not Visible in Navigation
- Custom menu with Walker class – what should the $db_fields be?
- Editing/Removing Secondary Menu from Divi
- Change “login/register” to “useraccount” when a user has logged in
- Question regarding register_nav_menus();
- Making wordpress menu horizontal [closed]
- Display same menu for parent and all its children
- WordPress Navigation default output
- Specifying Class style for Menu
- Convert HTML code to WordPress menu
- How to view menu and submenus in URL
- Permalinks linking to similar named site
- Hamburger Navigation Menu
- Custom navigation / menu output (walker?)
- How does WP knows which template to use for a page
- Using walker to display all menu branches at once?
- How to add a class directly on a unordered list element that is a primary navigation