try this instead:
...
global $post;
while ($q_query->have_posts()){
$q_query->the_post();
$loophtml .= "<li><span class="list-question-title">" . "<a class="list-answer-link" href="" . get_permalink() ."">" . get_the_title() . "</a></span>";
$loophtml .= get_the_content();
$loophtml .= "<span class="list-number-answers">" . get_comments_number() . " comentarios</span> · <a href="" . get_permalink() ."">Comentar</a>";
$loophtml .= "</li>";
}
wp_reset_query();
...
Related Posts:
- How to get URL of current page displayed?
- What is This esc_html_e() i wordpress php?
- Display only text to WordPress loop without loosing the text formatting
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- Store loop into array
- Looping through WP_Post Object
- WordPress loop specific thumbnail size
- get understrap pagination to work with custom query
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Displaying Only Certain Tags in Loop
- Show Custom Taxonomy Title
- How to exclude specific category from the get_the_category(); array
- How can i display post loop in table format?
- spliting posts into two columns
- How to speed up a wordpress function with multiple loops?
- How to select WooCommerce products by post_meta and order them
- How to Display a Single Post Excerpt
- $wpdb->flush(); breaks the loop
- Use object in template part
- 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
- Using loop pagination on single.php
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Iterate through posts based on array of categories
- get author_name from queried post
- how to refresh div on template part?
- Alert Bar section within WP loop is displaying even though there are no posts
- Display category name only once inside loop
- Load wordpress content in other domain
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- post thumbnail, conditions, else wont work
- wp_query get the 2nd post
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to add div blocks after certain set of post
- How to avoid duplicates when creating recent network posts
- Why in my theme I can’t see all the statics content under the posts?
- How do I remove a category from a wordpress loop>
- variable value disappears in a second loop
- How to unlink all posts from tracking same amount of views
- Why my loop isn’t working? [closed]
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Problem with custom loop and wp_list_pluck [closed]
- Display child page content of a specific parent on home page
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- WordPress loop is not working
- Echo array value
- First post article different on Archives template
- How to add title attribute to archive items
- Strip from or something better?
- How to break up php code to avoid echo
- Problem in replacing the_content with the_excerpt()
- Products listing check if meta checkbox is checked
- 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
- 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
- Latest posts feed with a specific post always first
- Show the subcategory name based on current product
- How can I get my pagination loop to display the correct number of total pages?
- How do if all posts has this category ID then do this
- ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
- View tag description on page
- Get current_post in reverse order with pagination
- How fix error in the WordPress loop?
- Efficient way of querying for a “fallback” post?
- Insert div after every three posts in home.php [duplicate]
- Display product attributes for current product
- Div Missing In Custom Loop Query
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- enumerating custom taxonomies?
- Using page template to fetch posts in page
- Create Customization Controls from Array
- ACF loop and php formatting
- How to display thumbnail if post is assigned one otherwise not
- How to have post count after each listed category
- How can I put a custom field as the link of a button shortcode?
- Pagenav Not appearing on custom Template
- Transient Loop Not working as expected
- Custom Meta Box If Else Statement
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Conditional in foreach loop is outputting content twice
- Alternative loop syntax error [closed]
- Pagination in category.php not functioning
- is there away to hide php code in wordpress not to show in PAGES
- How to handle parent and child pages?
- 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