Change the line with the URL:
<a href="https://wordpress.stackexchange.com/questions/70644/<?php echo get_option("home'); ?>/"><div id="logo">
… and check if the user is logged in:
<a href="https://wordpress.stackexchange.com/questions/70644/<?php
if ( is_user_logged_in() )
{
echo admin_url("/themes.php?page=wptuts-settings' );
}
else
{
echo home_url( "https://wordpress.stackexchange.com/" );
}
?>/"><div id="logo">
And echo get_option('home');
is not correct.
See wp-includes/link-template.php:home_url()
to understand why the real home URL is a little bit more complex.
Related Posts:
- wp_enqueue_script adding conditional statement not working
- Check if first paragraph is an image, then show custom code right after it?
- If post author role is X
- Can a conditional statement apply to part of a slug?
- Add default content to posts in a specific category?
- is_front_page, is_page(‘slug’), is_page(id) not working
- Need help on creating If-statement for custom meta fields
- How to make gravatar.com avatars conditional?
- Loading Scripts on Specific Pages
- Condition function for is parent category?
- Conditional Statement – Best Way to Remove Nav on Contact Page
- Proper syntax for simple conditional bloginfo language
- wordpress is_page() problem
- Location-Based Content
- Personalized message for each unique password-protected page
- Conditional Shortcode image display
- Change Woocommerce order button page on particular page
- to create own conditional tags for business directory in wp
- How to use “Cases” instead of “IFs” for conditional logic
- Which is the better way to write a conditional statement? [closed]
- Nested conditionals
- Is there a way to password-protect part of a post?
- if/Else have_posts Else fails to echo message to page
- Conditonal statement for iPad
- Return function only on certain pages
- How to write this conditional statement?
- Conditional for Custom Post Types
- Date-Based Conditional Tag
- Message box when accessed from iPad
- Show this code if user has previously left a comment
- Insert a conditional in the middle of a function to give it 2 different outcomes
- How can I use ‘edit_form_after_title’ conditionally?
- Force Log in to view a page
- Conditional loading of CSS for my plugin
- Looks like this if condition is not working [closed]
- Generating images from an array of categories
- WP conditional site logo and header block
- How to know if the most recent article
- Widget logic conditional widget
- How to display image on condition that a selection has been made
- How to Conditionally Not Display a Link Based on Current URL?
- Allow users to only CREATE one single (custom) post
- If statement to check for post_content
- why is my custom loop failing?
- Conditional sidebar menu
- What is the best way to disable my WP website if the user has adblocker on? [closed]
- Enqueue Scripts / Styles when shortcode is present
- wp enqueue style on specific page templates
- Loading scripts only if a particular shortcode or widget is present
- How to conditionally enqueue a stylesheet only for a certain page(s)?
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- Show different different menu in theme_location depending on x
- meta content on required pages
- How to hide and content from auto-generated excerpts?
- Alternate text if shortcode returns no data
- Conditional Ajax inclusion
- How to do conditional publishing?
- A function like is_page() but returns true if on any sub page of given page
- Check to see if specific loop has less than certain amount of posts
- functions.php conditional tag – only show in single.php?
- How to Add Javascript Only When a Function Exists?
- Get all children page ID’s including parent by title
- How do display simple page for printing product info? [closed]
- Duplicating Table of Contents for Paginated Post
- How to not show post_thumbnail from specific category for not logged users
- Plugin Code ONLY on Post Edit Page
- WP for main site and two blogs – implementation
- Prevent update of custom user profile meta field on the front end after 1st entry
- Is_front_page inside header.php is always returning true
- Adding a template part as part of a shortcode
- is_main_site() Always Returns True
- PHP conditional script issue
- Conditionals if tags exist?
- Where do you add code in custom fuctions so it works on a specific page?
- If user is logged in and has a role echo statement
- Banner appearing on Pages but not Posts; call it conditional confusion
- If custom taxonomy else conditional [closed]
- Why is the `if else` not working?
- Check if has pages?
- How do I test whether [gallery] is empty?
- How to display conditional menus with Twenty-twenty two theme (and other new block themes)?
- can you help review CCCP (Conditional Cookie Content Post) and help to create a block?
- How do I make content only load on desktop? [duplicate]
- Use modulo condition in ACF repeater Field
- Change Login or Logout text based on status
- Modify wp-login.php Labels Conditionally Based On Referring URL
- Show code only on WooCommerce Pages
- Conditional Fields depending on checkboxes
- Conditional: IF current author’s custom post has a post thumbnail
- Understanding and using did_action() in a conditional statement
- If Month=Particular month display content [closed]
- Php conditional help needed
- functions.php conditional output for a single plugin
- How do I add a nested conditional within an echo – to use a default image if there isn’t one in the post?
- Template tag for /page/# structure
- Create citation and url in post using 3 custom fields with conditions for each field… So close!
- Loop to pull content from parent element in custom post type [duplicate]
- Is There a Way to Schedule URL to Content Updates?
- Weird html output of single_cat_title – is not inside of the html element?
- How to set up a echo? [closed]