the_permalink()
prints url immediately and returns nothing, you should use get_the_permalink()
function, which returns current post url.
Related Posts:
- Display a query with multiple post types and same relationship on a single page
- WordPress Custom Post Types with a page as a parent?
- List page for custom post type?
- Categories under custom post types doesn’t show properly
- Display children and grandchildren of a custom post type
- is_page_template not working as expected
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Conditional to modify query results
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Return array of categories to php function for current post
- Create a random unique 6 digit number as custom field for custom post type
- Loading all files within a directory
- Get rewrite slug of custom post type in template
- What’s the difference between same wp functions get_posts(); functions in different form?
- how to check if custom post type column already exists?
- How to make a field appear only if a post meta field has a defined value?
- Can I list a custom post type within another custom post type in the admin area?
- Checking if Post Title is Unique as Loop Criteria
- On update or create post redirect to current post position in list
- Redirect 404 page with ID in slug to associated page with same ID in slug
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- WP_Query Custom Post Type if Category ID Equals
- Control content before and after custom post type loop
- How to use a variable as a function name?
- Saving fields in a drop-down in WordPress
- Assigning a category to a custom post type in WordPress
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Different options per post type in WP_Query
- Show message when query has no posts
- How do I create a new post upon registration with the users first and last name as title
- Creating a non-hierarchical Taxonomy that behaves like categories
- Shortcode is displaying the content on top of the page [duplicate]
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- How to set the mainpage of a custom post type?
- custom post type by author – wp job manager
- Using Wp_Query, Json to add Highcharts series data
- Accessing a protected property of a post
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Let users upload image(s) to the post from front end
- Foreach loop returning more than one item when querying taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Using page title as a link to term archive
- How to display custom post type only on a certain page?
- Setup page template array in a custom post type
- WordPress sitemap with Custom Post Types
- How can I sort the order of multiple custom field values in a custom post type?
- How do I ensure that post_type and Taxonomy use the same slug?
- Custom post type page with parameter
- pagination for custom post type archive page
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom fields array to display it monthly
- How to show the post which checkbox is not selected
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- Is it possible to get the specific content on the search page?
- php dynamic content inside shortcode
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Check that a slug is present in the get_terms request
- open custom post type in popup window instead of page
- Get category name of custom post type
- pagination problem listing custom post types of taxonomy in wordpress
- In the php, how can I have a category of a custom post type display?
- Set a template on a custom post in the plugin
- Persist meta box choices throughout all posts of same post type
- Do not show child pages within a file page
- Taxonomy doesn’t follow slug permalink structure
- Looping to organize and display custom posts by category using PHP and WordPress
- Search result based on URL
- Custom search for a custom post type in WordPress
- Custom Post By Category
- Display a list of sub-pages of Custom Post Type Parent Page
- test if something is a post or a taxonomy
- How to mix 2 kinds of post types
- Create unordered list from custom field type entires separated by a comma
- ACF Post Content Not Being Searched
- Strange behavior on WP_query
- Show custom taxonomy not in submenu
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Loop carousel slider in wordpress
- Custom Post save causes 500 error
- Custom post tag images not displaying with ACF
- Function not pulling image or text from custom post type
- WordPress Custom Post Type and sort by Tags
- How to call Shortcode categories for custom post types?
- Looping taxonomy in taxonomy?
- Permalink of Custom Post Type
- posting twice from an array?
- Stop header code from showing in category page?
- Pagination not working on homepage
- Custom Loop for custom post type. Compare by meta_value?
- Query Custom Post Type by Tag
- Order custom post type is beign ignored
- How do I filter a custom post type loop by a field?
- How to manage wordpress knowledge base/wiki/posts collections
- How to string lines from the_content() hook in WordPress?
- Getting ACF relationship field information
- how to display custom taxonomies in front page