You need to use get_permalink()
, which will return the URL as opposed to echo’ing it.
Related Posts:
- Custom PHP form needs refresh to load page correctly
- Child-Theme Category View with modified permalinks (%category% removed)
- What are the advantages/disadvantages of ways to use php template files?
- Using Google Analytics in an enqueued JS file
- I can’t go to the page archive-{post_type}.php
- Configure WordPress to Use Responsive Image Rendering
- How to use data URL in WordPress?
- HTML comment cause issue in functions.php script root
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- Slug duplicates once clicking on link
- couldnt show short code atts in category
- Add Link to PHP message
- separate list of programs in html/javascript coming from php
- Remove span tags from WooCommerce Downloads page
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Drop down question
- How to enable HTML tags in category description without breaking the category page
- How to use wp_ajax_set_post_thumbnail?
- WP Website is shown in HTML
- Passing a value from an input field to a php function in WordPress?
- How do I disable cache for a certain page?
- Use Search Term in html link and redirect
- Can’t display anything through homepage text editor
- Mysterious letters appearing at the top of a few pages
- Comparison operator != not working in field [closed]
- Current WordPress Page Title as Search Parameter into A Tag
- How to find and delete a menu item in php?
- Rewrite rule not working, but only when parameter is text
- If user has clicked link add class and store using PHP/WordPress
- How can I edit the final HTML structure of the whole web page
- My single.php page skips the first div tag
- Install functionality for push notifications but WP-Theme has oddly-named, hidden source files [closed]
- Custom woocommerce payment gateway – Form
- opens like sitename.com/URL
- AJAX and custom pages
- How does Permalink work with the AMP plugin after Removing Parent Permalink Catalog from Posts
- Get WordPress username to customize url
- WordPress Slider is not working
- Permalink doesn’t navigate to post (changes only url)
- Post permalink buttons all going to the first post
- Problem with my Login Plugin
- How to return html as a string from php for WordPress
- Permalink changes after several minutes after saving post
- How to display post meta bellow every posts
- How to edit button permalink inside function.php using a child theme?
- HTML Formatting “single_term_title()”?
- how to add functions to my function.php using a child theme?
- How to Protect a private folder inside uploads folder, if User is not Logged In?
- WordPress/NGINX not respecting the category URL for new posts
- Show subcategory name selected in specific category woocoommerce
- WordPress generates weird permalinks
- Make a full-width wordpress page
- How to center all text body in single.php at once?
- How can I create a shortcode from an html and php code written together
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- sessionStorage saves input value in browser but it is not loaded in the form field
- Collapsible menu on post sidebar only expands and does not collapse
- Permalink like example.com/taxonomy/post_type/postname
- Unable to insert current username into custom table through html form
- How do I stop my form from adding code to current page URL instead of re-directing. Been stuck for days
- image on homepage disappeared due to change of permalink name
- Changable favicon
- How can I get my pagination loop to display the correct number of total pages?
- Woocommerce custom attributes list help
- WooCommerce multiple custom fields code
- How to override html codes in wordpress?
- Access certain Entry in HTML-Table and pass the entry-data in WP not working [closed]
- AMP version of e-commerce without plugin
- Custom content using in_category
- Allowing HTML elements in title widgets spacing problem
- Target a specific container to style on WordPress storefront theme
- What is the proper way to call a function (from functions.php) on a link click?
- Switch position of elements in the footer [closed]
- Add Text Area To Child Theme’s Home Page
- How to include different html tags in the header for different pages?
- Use PHP to inject HTML into before page renders?
- Create html tree sitemap
- wordpress form action page not found
- How to make a parent page for author.php?
- Creating Log-In Page for backend server
- Can’t get_users info by using json_encode
- user update profile for custom code
- scroll scrpit to particular button position to next id when click button
- Vertical Menu for one page only
- Remove slug of multiple custom post types with and without hierarchical
- Modify the permalink structure for a specific category
- How to add input field value to Users in WordPress Dashboard
- change the blog in the url if you go from a specific page wordpress
- Is It Possible to Block Redirect Checker Tools from Knowing Where URLs are Redirected?
- Is it possible to go to the next post in the same category?
- separating column the variations from the add to cart button woocommerce
- How can we upload custom page files?
- Extracting and Replacing HTML Post content with PHP DOM
- Get variable from url
- WordPress per ACF – permalink is not working
- Processing data and redirecting with query string
- I’ve added SKU to Woocommerce permalinks, but I have small issue
- Post returns 404 after changing the permalink using post_type_link
- How can I process a form submission from an HTTP POST request?
- Cannot access the other pages after successfully editing post type