the_permalink echos out the permalink of the current post to the frontend.
get_permalink however returns it as a variable, but does not echo it out. You can also pass a post ID to it if you want the permalink of another post.
the_permalink is equivalent to:
echo get_permalink();
Which is very close to what it actually does. This is the implementation of the_permalink:
function the_permalink() {
echo esc_url( apply_filters( 'the_permalink', get_permalink() ) );
}
Related Posts:
- Use author author display name in permalink structure for pages and posts
- paginate_links() don’t properly work in search.php?
- Refresh page after form action
- Convert hyphen to underscore in permalinks
- Adjust which tempalte a page uses with a function?
- Generate permalinks
- Disable shortlinks like ?p=1234 to prevent scraping
- Manipulate Permalink
- How to get correct URLs in network wide menu (Multisite)?
- Where to add the permalink in this function?
- paginate_links() don’t properly work in search.php?
- How to fix get_the_category function returning incorrect slug?
- Test if a post exists by category and date
- How to properly refresh page after form action?
- Setting Permalinks in wp_config or functions file?
- Redirect to post after publish or update a published post
- How to add extra value to permalink
- How Can I Create a Friendly Slug for a Dynamic Page?
- Add #primary at the end of navlink permalinks on single posts
- Filter posts on new page
- Check if excerpt is empty at loop-portfolio
- Exclude javascript in certain page url and all following url’s after forward slash
- Why isn’t is_page working when I put it in the functions.php file?
- Add image size if page template
- How to load parent_theme functions.php before child_theme?
- How to use the do_action () with parameter
- TinyMCE custom styles remove class when switching styles
- Add admin bar link to edit author
- Extending the site search to include a single custom field
- Notify users whenever a new post is published based on their preference
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Remove Header and Footer in iframe
- How to Acheive the custom woocommerce category template
- Can I remove the Rich Text box editor for a specific post?
- How to add CSS style sheet dynamically in wordpress
- How to update BuddyPress xprofile fields programmatically? [closed]
- Redirect if not logged in?
- A snippet after every image
- Programmatically set page template based on page ID
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- wp_remote_post with ssl:// protocol
- Best way to programatically add “rel” attributes to page and post images
- Remove function or filter
- options.php problem – data not saved
- Filtering posts by category name based on page’s slug
- adding custom classes for tables
- CSS for menu item added via functions.php
- Default Gallery Edit/Template Editable?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Override a theme function in a child theme?
- changing behaviour of get_search_form
- Include default functions and methods
- How can I modify all existing tags while keeping the urls themselves?
- Scripts not appending to element in AJAX call – why?
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Functions.php – Cannot Modify Header Information SOLVED [closed]
- How would I add “edit profile” and “blog post” functions to front-end?
- Function to update post_meta based on existing post_meta
- Load jquery only for certain pages in the backend
- Custom styles.css sheet for visual editor
- Publishing just a Facebook URL without full code snippet
- Filter an WordPress Function in (general-template.php)
- Show some menu sub items as dropdown under a menu item
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- The correct way to add a JavaScript in the functions.php [closed]
- How to remove some item from WordPress Dashboard for user Author
- Disabling Author Page only for subscribers
- Showing user profile data on front-end
- How to register a menu based on a ACF condition
- How to convert raw url to hyperlink?
- Breaking up multiple words and inserting an image after first word
- get content from page through AJAX
- colorbox not loading in
- how can I change all wordpress media file url to custom cdn url?
- Changing the HTML of notices in WooCommerce [closed]
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Modify content inside post before first publish
- Pass an argument into a function to extract from array
- function class doesnt work
- how to remove a tag in the_category function
- Load CSS file conditionally
- my wordpress doesn’t save items to customized widget area
- Copying a widget class to functions.php results on a blank page
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Changing the register url is not working
- Newest comments first not working
- Pass arguments to function class with do_action()
- How to a override parent theme page that has been included with require_once?
- WordPress permalink setting
- Can I use a function to return HTML and the result of another function?
- Excerpt length: get 2 paragraphs
- Remove heading tags on line break
- Sort results by name & asc order on homepage
- I want to add the alt attribute to all the photos!
- Creating mixture of shortcodes to use in the visual/text editor
- Is storing in a variable the result of a fonction a most powerful way to code an if structures in WordPress?
- Add functionality to block comment authors in the Comment edit pag
- Abbreviate WordPress post view numbers