I’m not really sure what you’re trying to achieve with the is_page
parts – maybe I’m missing something – but what if you’d just write:
if (is_user_logged_in()) {
$my_account = "My Account";
echo ($my_account);
} else {
$login = "Login/Sign Up";
echo ($login);
}
return
just returns the variables for use in your code, echo
prints them to the HTML
Related Posts:
- Remove Container Element From wp_nav_menu() Markup
- Breadcrumbs showing Parent and Child Pages
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Menu fallback “menu_class” rendering a “div” instead of a “ul”
- How do I create page navigation linking to each H2 within the page? [closed]
- Custom Static Links For Specific Menu Right Before/Next The wp_nav_menu Function now working
- Hard-coding custom menu elements for menu manager
- Categories as main menu items and subcategories as nested lists
- retrieves menu and converts it to a readable array
- Secondary Menu and Logged In Users
- Default Nav Highlight
- Multiple navigation menu in same location
- Bizarre Child Menu Issue on WP Site
- Header menu aligned right on all pages except for single-post page [closed]
- How to automatically add counted number to navigation menu items?
- How to add widget in main menu
- Add multiple custom fields to the general settings page
- Get menu object from theme_location
- Is it possible to remove the “standard” post format?
- Woocommerce add to simple product attribute programmatically [closed]
- Issue with get_theme_mod returning a blank value instead of the saved value
- How to remove row-actions from pages table?
- Using wp_get_nav_menu_items() to list children of children pages
- Modify search function in WordPress (TwentyTwelve)
- Custom menus displaying all pages instead of set pages
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- How to fix a theme with page.php Default Template that accidentally deleted?
- Two different menus for two different locations?
- How do I change parameters without changing the core
- Problem with extract() with custom shortcode
- add sidebar area to header of child theme
- Editing or filtering the output of the Genesis navigation
- Theme-Config tab in admin Pannel?
- Creating loop within functions.php
- adding custom classes for tables
- Pass Shortcode Attribute to footer Script
- How Can I Expand the WordPress Customize window without any Plugin?
- CSS for menu item added via functions.php
- wp_dropdown_categories and custom attribute
- Replace menu links with # and add name to its li
- Function issue with Walker_Nav_Menu [duplicate]
- Automatically wrap multiple images in div
- Ajax not working properly
- Make parent page only link to first subpage
- wp_nav_menu, walker class, categories as classes of li
- Include default functions and methods
- How can I remove the main description text box in a Woocommerce product editor page? I only use the “Product short description” text box [closed]
- How can I modify all existing tags while keeping the urls themselves?
- Unable to login using username
- How to get correct URLs in network wide menu (Multisite)?
- Using my WordPress menu on another platform
- append to existing parent theme function
- different style sheet for just one page template
- Condition OR for current user ID
- Where do I store custom functions that call custom page template files?
- Add login hyperlink to secondary navigation menu
- Dropline menus — seperators between children only?
- Wp-query Order By problem
- Functions php shortcode for displaying main menu with no child items
- login_headertitle is deprecated since version 5.2.0
- Add attribute only to first image of every post via functions.php
- Different favicon on different pages
- Problem with images URL after filter applying
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- Nav-Menu not showing up
- Insert a field with PREG_REPLACE – strange behaviour
- How to echo Widget Title in Custom Frontend-Template Box
- how to display a page before the home page
- search form leads to 404
- loginout function customization
- How Can I add a menu to the theme from withen the function.php file
- define css class in functions.php
- implementing a centralized content “show-do-not-show” toggle?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Custom menu not showing even though it shows as being registered?
- How to remove font awesome from loading in wp theme
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Combine multiple menus using the filter wp_nav_menu_items
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- WordPress Ajaxifying not working properly
- WordPress function with attribute pass to template
- remove or hide Link Relationship (XFN) form Menus tab
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Adding A New Widget to WordPress Disables the Existing Widgets
- Help! Need a different logo on my main page from my other pages
- Display page number on custom page title function
- How to replace words in my posts and saved new words
- Insert menu into theme location depending on user logged in/out status
- Add functionality to post editor
- Calling the first & last post by category in custom post type
- Why does modifying my functions.php file always result in a server error
- How do I get my nav menu to show sub pages?
- Remove snippets of JS from core
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- removing extra mobile menu from the header
- Explode Array from Repeatable Custom Field
- WordPress Custom wp mail template return full template
- Custom Menu (only showing direct cildren) ACF not showing
- post_row_actions filter from parent theme not executing in child theme