Note that it might be easier to use get_comments()
here, since it’s defined as:
function get_comments( $args="" ) {
$query = new WP_Comment_Query;
return $query->query( $args );
}
If you need the comment url, within your foreach
comment loop, you can use:
$comment_url = esc_url( get_comment_link( $comment ) );
You can also get the post id from the $comment
object with:
$post_id = $comment->comment_post_ID;
then you can use that to retrieve the custom post meta:
$property_address = get_post_meta( $post_id ,'imic_property_site_address',true);
To get the corresponding post permalink
$post_url = esc_url( get_permalink( $post_id ) );
Related Posts:
- WordPress loop by meta key that is an array? and how loop multiple arrays
- How to add post meta in while loop?
- Efficient way of querying for a “fallback” post?
- How to get URL of current page displayed?
- What is This esc_html_e() i wordpress php?
- Getting the comment number relative to all the post’s comments
- How to update single value in multi dimensional Post Meta?
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- WordPress loop specific thumbnail size
- Add “last” and “first” to WordPress Comment Pagination Links
- Show Custom Taxonomy Title
- How can i display post loop in table format?
- spliting posts into two columns
- How to select WooCommerce products by post_meta and order them
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Cannot display or echo alt text on featured image
- Using Advanced Custom Fields to create a per page slider
- WordPress Search Results for Multiple Post Types
- Changing layout with wp_customise
- “comments.php” not available after edit in WP administration
- Using loop pagination on single.php
- Show wp_die if url form comment not emply
- Sort custom meta column by other meta value
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- get author_name from queried post
- How to implement a rating and review system for WordPress custom posts?
- how to refresh div on template part?
- Display category name only once inside loop
- Commenting out unwated CSS/scripts in HTML with PHP
- php function to display commenter username or login
- check if comment submitted was successful
- Alter required message using comment form api
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Does anyone know all parameters of get_comments()
- Why in my theme I can’t see all the statics content under the posts?
- wp_delete_comment takes two tries to delete – then deletes all comments
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- How to unlink all posts from tracking same amount of views
- Why my loop isn’t working? [closed]
- Problem with custom loop and wp_list_pluck [closed]
- Update post meta – Custom field does not match meta-key
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- Restrict characters in comment section
- Define category ID using get_post_meta
- Update value of a associative array with update_post_meta
- First post article different on Archives template
- Front end file upload returning wrong attachment url
- How to add title attribute to archive items
- Strip from or something better?
- I don’t have comments.php… how do I customize my comment fields
- Problem in replacing the_content with the_excerpt()
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Order category posts by last word of custom field
- in_array not working on dev server but works on localhost
- How to Create Carousel Indicators in PHP Loop using wp_get_attachment_url function?
- Get title of page containing post grid within the posts
- Is there anyway I can call the year once?
- Display all categories including sub categories under a list ul
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- Where does php code to load data go?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- cURL needing to loop through all “next_page”
- Display page content in different sections – based on page break block?
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Hide author from search results meta, still display date and categories
- Fix common misspellings/errors based on array of replacements
- Latest posts feed with a specific post always first
- Show the subcategory name based on current product
- Unable to update the meta boxes with multiple fields
- How can I get my pagination loop to display the correct number of total pages?
- How to add delete, approve, spam Links to Comments
- Get current_post in reverse order with pagination
- Adding user meta to post meta wp_insert_post() not working
- What’s the correct offset value for order ASC?
- How fix error in the WordPress loop?
- Div Missing In Custom Loop Query
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- Using page template to fetch posts in page
- Post from front end form to post_meta
- Create Customization Controls from Array
- Order by in foreach
- If custom field doesn’t exist, or exists and it’s true show title?
- ACF loop and php formatting
- get_post_meta no longer working
- Custom Meta Box If Else Statement
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Alternative loop syntax error [closed]
- Trouble figuring out how to get my button to submit comment
- Metadata on the WP_Post object
- How to create a loop that will display one post and stop?
- Woocommerce linking variations
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Saving meta box data from selected option’s value in database is not working
- Permissions error when I use my plugin to delete comments in the front-end