You need to use the equivalent functions that return their value. Those are get_the_permalink()
and get_the_title()
.
Most WordPress template functions that begin with the_
and echo their values have equivalent functions that return their values that begin with get_the_
,
Related Posts:
- shortcode to output multiple images urls from media library id
- How to link to current post in WordPress?
- Get new WordPress slug from old wordpress slug
- Is there a way to show attachment IDs on the attachment info screen?
- Shortcodes not working
- Do shortcodes in title before permalink is generated
- get_posts displaying wrong permalink for “continue reading” link
- where is permalink info stored in database?
- Passing and retrieving query vars in wordpress
- Get the current page URL (including pagination)
- How can I reverse engineer a Permalink to Find the Page?
- Mapping Domains to Permalinks (not multisite)
- How to remove dates from existing permalinks?
- Setting up WordPress with Custom Permalinks and no .htaccess File?
- How would I create a different permalink structure for pages and posts?
- My permalinks are broken! Can I use mod_rewrite to ignore a physical file?
- Is there an action for when permalinks are rebuilt?
- When creating a WordPress page, a “-2” suffix is added to new pages’ permalinks
- mod_rewrite enabled but Permalinks show index.php
- Why does /wp-json/ not work on the “plain” permalink structure?
- Custom Permalink: /year/month/post-goes-here/?
- How to change “permalink” structure in “WordPress Thesis” theme?
- Turn off %postname% auto-incrementing?
- How to get the post id from a permalink?
- Does a parent page’s post_title have to appear in a child page permalink?
- Stop redirecting to posts not in a category / duplicate slugs
- How to make variables in URL look like the permalink structure?
- Custom Taxonomy URL
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- Custom attachment permalink structure [closed]
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- Why does chrome keep downloading a file instead of running the site?
- Re-write specific custom post type category URL to go to another page
- Get page by path – honoring permalink settings (urls w/slashes)
- How to change the permalink option to post name on theme activation?
- Does rename of page slugs create 301 redirects from old slug to new (same as for posts)?
- Pagination Issue – /page/2 404
- How to stop WordPress from removing & from URL?
- Nginx Rewrite Rule:: index.html added to every permalink
- Change permalinks on move from one site to another
- Making permalinks to /%postname%/ by default in installation
- Share same Slug for a Custom Post Type and 2 Taxonomies
- Custom Post Type Yearly Archive Permalinks
- Post with Custom Permalinks
- Can’t select blog month within archive category
- Passing the JQuery string to Worldpress URL
- An other permalink problem – 404 Error
- permalink results to “page not found”
- How to prevent WP overwriting my custom htaccess rewrites?
- Format HTTP links
- Permalinks on post is working, on pages 404 error
- Change directory url to be same as page permalink?
- Some Pemalink problems, probably caused by wrong .htaccess configuration?
- Permalinks set to /%postname%/ but still have links being indexed in the form ?p=x
- WordPress author.php template does not work with custom permalink structure! Help!
- LAMP WordPress Permalinks 404 error
- Links in post content don’t work on home page
- Arabic permalink redirect to home page
- Changing permalink settings causes 404
- Issues when changing permalink Structure
- Non Latin page permalink problem
- Custom permalink structure for product
- index.php in URL
- archive by year and category: permalink support doesn’t work on pagination
- Empty the_excerpt() broke the_permalink() under him?
- Permalink not changing according to post type
- iFrame permalinks on WordPress
- Custom permalink structure with a prefix just for posts
- How to change permalink for listings
- WordPress Pages that use Domain URL
- 404 page not found – Yet open admin page it works
- How can I have a page’s permalink include my custom post type’s slug?
- wordpress admin panel loop on nginx
- Can’t access new WP install on subdirectory
- WordPress Permalinks
- Problem with permalinks
- Find internal links to post
- How to change link of an uploaded file to the media library
- On Macbook, my permalinks with post name don’t work. Returning 404 error
- “Undefined” added to page content after google Adwords click
- WordPress pages break with custom permalink settings (theme directory not output)
- Remove /index.php from Permalink
- Image upload ruined my links
- How to rewrite a folder in WordPress?
- Tag search not working after permalink structure change
- Why is there a # and other characters in URL for WordPress site?
- redirect old pages by .htaccess
- wp_get_attachment_url not working
- Custom permalink to make a page respond properly
- WordPress 3.1 problem, getting 404
- Display a custom slug in URL depending on user variable
- Redirect Loops Problems
- Problems loading stylesheet and permalinks after rebooting
- WordPress Permalinks 404 Not Found
- WordPress 6.1.1 UTF8 Slug Limit Increase
- 301 Redirect posts to newly added categories
- How to have category/subcategory/posttitle/ permalinks?
- make a new structure tag that does some processing
- Website appears with wrong permalink in Google’s search