post_name
would be the slug as it was set before the page became the front page. When the URL for the front page is output via the API, the get_page_link
function checks if the ID matches the page_on_front
option and returns the home_url
in that case. This is why you should always use the API to output data and not directly access post object fields.
Related Posts:
- How to declare a global variable in php?
- Undefined variable in functions.php file [closed]
- load/require specific php files for specific pages/templates/post types
- Activate different theme for temporary preview
- Execute a shortcode when clicking on a image
- get_the_content if it contains multiple lines it results in SyntaxError
- Store loop into array
- How to enlarge the media file upload size in wordpress admin
- Add a custom text field to WooCommerce admin product data “Variations”
- Show Specific Footer Widget for Specific Pages
- Why is it necessary to prevent direct access to included files?
- Run a Parallel PHP Application with WordPress
- Display Post co-authored in Author Page
- Include Class File in WordPress
- How can I use a $wp_customize to edit my homepage image slider?
- Password protecting content in custom template
- Creating login session via CURL
- WordPress vs. Custom PHP [closed]
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- How do I display a user’s previous orders as a select box option on a product?
- How to Highlight unread WordPress posts?
- ajax, right way to do it and make it works?
- Is there CSS to expand the gallery limit on Index Pages?
- Hide categories that are not used in the post type
- How to combine wordpress_logged_in cookies in one cookie?
- Automated Cart Update With Alert Box Each Time
- Is it possible to increase php memory without directives in wp-config.php, .htaccess or php.ini?
- Adding widgets to my plugin page instead of WordPress dashboard
- How can I add an area/option for a custom page description?
- Menu jumping when calling it via PHP
- Problem custom control Customizer
- Running code before object-cache.php runs
- How to escape attachment image caption text?
- WordPress admin is incredibly slow [closed]
- Archive post by meta value + 24hours
- Configure Php server with ISAP
- Is there a way to conditionally check whether a WordPress post title is empty?
- Shortcode to show the code
- How to parse multiple links from one variable?
- Issue with php version 7.2 in running search
- How Can I Edit the Registration Code?
- What is the right way to add PHP code to a certain part of a page
- Can I make get_users() query global?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- Display attribute on shop page after the title
- Cant connect to database with php 7.3
- iframe not showing in content on blog page
- WordPress WP_Query without query GET parameters
- How to clone all WordPress Rest API end points
- Get the name of menu item with wp_nav_menu
- What’s wrong with this piece of code? [closed]
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- Initial offset of number of posts in home page on the posts page
- Run JS Code on userlog out
- Twentyfifteen style author comment
- I installed WordPress locally now how do I login?
- How to prevent a function from running based on host (ie web vs local)?
- Change out put of the_post_thumbnail in PHP
- Styling an “active” link outside of WordPress default menu
- WordPress permalink issue
- Any way to hide a blog posts text if it’s longer than let’s say 300 characters
- Array data not saving to specified sections. How to make seting independantly?
- How to get woocommerce orders with get_posts method in a shortcode
- Change category thumbnail size
- how to make wordpress user submit form once?
- Update PHP version of WordPress (internal hosting)
- Multiple Tag Filtering
- Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?
- Need to show 7 posts from actual date
- How to reload a php script, using AJAX and jQuery
- Notice: Undefined variable
- Make wp_editor required
- Add the shortcodes from the enfold theme to the other theme
- I need to edit a widget, with no dashboard access
- Custom content using in_category
- Get the total Author Favorited posts
- How to properly create multiple conditions to redirect users roles to different pages
- unable to add category in creating post dynamically
- Need help with PHP functions
- WordPress WPDB::insert 13th param is always blank (only if format)
- When using shortcode, content stops generating after the_content
- MySQL query in WordPress with AJAX
- enumerating custom taxonomies?
- Change colour of table td based on value
- How do you detect if a specific word is at the end of a the_title()
- WordPress styling recent post
- If or/and statement advanced custom fields [closed]
- Combining fancybox with multiple thumbnail plugin
- How to display thumbnail if post is assigned one otherwise not
- How to check “From Email” via WordPress before an email is sent
- Add specific phrase after every product title including the discounted price? [closed]
- get_avatar from user id
- Remove Unused Menu Locations
- How do I change the Go To Categories link in the term_updated_messages
- wp_mail vs mail functions and header arrays
- How to sort wordpress posts by selecting a year from a drop down?
- WooCommerce Checkout Cart [closed]
- How can I get values from a custom post type depending on where I click on my SVG map?
- WordPress taxonomy and terms question