Make use of the get_comment_link
function in your foreach
loop like so:
foreach ($comments as $comment) {
$output .= '<li><strong>'
. $comment->comment_author
. ' said</strong> : "'
. '<a href="'
. get_comment_link( $comment->comment_post_ID )
. '">'
. strip_tags($comment->com_excerpt)
. '..."</a></li>';
}
Related Posts:
- Difference between the_permalink() and get_permalink() function
- Use author author display name in permalink structure for pages and posts
- paginate_links() don’t properly work in search.php?
- Remove Comments Metabox but still allow comments
- Refresh page after form action
- How can I remove the title “leave a reply” in the comment box in twentyeleven?
- change the comment time output to: X time ago instead of actual date and time
- How to get comments with mixed status using get_comments?
- How to prevent deleting of comments when deleting a post
- Convert hyphen to underscore in permalinks
- disable comments if array exists
- Remove “says” from comments
- Display the number of user comments
- Adjust which tempalte a page uses with a function?
- Generate permalinks
- Comments to only be seen by their author
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Disable shortlinks like ?p=1234 to prevent scraping
- Show top commenters without using a plugin
- Manipulate Permalink
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- Commenter should see only his comments in wordpress
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- wp-comment author- url +, email filter hook
- How to get correct URLs in network wide menu (Multisite)?
- paginate_links() don’t properly work in search.php?
- Incorrect redirect after commenting
- comments_popup_link without echo?
- Getting comment count per post not working
- Wp admin – Set default value to 999 in comments
- What is the Difference in bones_comments() and comments.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?
- Function to replace comment’s accented characters before posting
- Redirect to post after publish or update a published post
- WordPress comment_form() does not display actual comments
- WordPress comment processing . Default unapproved comments detection before posting
- How do I change where “You must be logged in to comment” directs users?
- How to add extra value to permalink
- How do I make the comment disappear after deleting from the database?
- How Can I Create a Friendly Slug for a Dynamic Page?
- Add #primary at the end of navlink permalinks on single posts
- Remove nofollow from internal comment links via functions.php
- How can I automatically delete comments that contain a URL?
- Warning and fatal error
- Comment function for page
- How to identify author in wordpress comments?
- Filter posts on new page
- How can I return the result of my custom function?
- Newest comments first not working
- get_comments not working properly after WordPress v4.4 update
- Getting error while trying to use custom comment function
- Check if excerpt is empty at loop-portfolio
- Increase Comment Author Gravatar Size On WordPress Default Comment Function
- Exclude javascript in certain page url and all following url’s after forward slash
- Custom Nested WordPress Comments with avatar
- Undo a function that is not (seemingly) hooked to an action?
- Comment Function
- WP Custom Comment Callback Not Responding
- How to remove “login to reply” from individual comments [duplicate]
- Getting full code of wp_list_comments instead of replacing it
- Comment turned Invisible
- User’s Comments Number: Storing it in a meta field for different uses
- Add functionality to block comment authors in the Comment edit pag
- comments_template() doesn’t work with ajax call
- How to use: WP_AJAX_GET_COMMENTS
- Custom permalink for post of one category
- WP backend, Show only own comments (give to users who wrote/published/assigned) posts
- How to Programmatically Replace Characters in WooCommerce Product Slugs?
- Sortable column (by numbers) in admin users
- Page get parameter doesn’t work with is_single() function
- How can I add a class to a nav li depending on URL?
- How to get post revisions in my custom rest API? [closed]
- Access category within rss2_head hook?
- How is $current_page passed in woocommerce_account_orders function?
- Hide thumbnail on search results when thumbnail not set – using Oxygen
- How to Extend login session times to a Month
- Does size of a theme’s functions.php file matter?
- How to add custom user avatar in wordpress
- Upgraded server now class My_Walker_Nav_Menu extends Walker_Nav_Menu not working
- retrieves menu and converts it to a readable array
- custom functions in function file delete automatically daily
- Using $WPDB to create simple array to check against user entered value
- Create custom function for hero image
- Functions php shortcode for displaying main menu with no child items
- What are the meta fields for an attachment?
- Can set_post_thumbnail be used to remove a thumbnail?
- Insert nofollow in a “Powered By” link, except in the homepage [closed]
- how to make has_block() see inside blocks too
- Use Composer Package inside class – Namespacing error
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- issue with if/elseif in_array inside foreach loop display only one post
- Can’t locate custom image sizes defined by child theme
- get_next_posts_link() returns no result despite available posts
- Randomizing wp_tag_cloud() in child theme
- Nav menus all outputting the same links
- How can i unload effect.min.js file?
- How to map numbers utilizing array function