I would like to include the latest questions from DWQA on the home page of my DW Wall site. How can I add it to the loop?
1 Answers
To include DWQA question on home page, You can log in to Dashboard > Setting > Reading then select “Front pages” section. (Example: Ask Question) See the screenshot:
I don’t want to replace the home page with only questions. I want to mix the latest questions in with my latest posts as additional tiles.
Currently, Our DW Wall does not yet support this issue. We will discuss about the issue in the next version.
I have modified the WordPress query to include the post type.
I think you have resolved the issue. I appreciate it !
Please login or Register to submit your answer
replied 11 years ago
Hi Rian, can you share how you solved this problem? I’m having the same problem and this is no code here… I’d like to show only the 2 or 3 lastest questions on home page. Today, I’m using the shortcode [dwqa-list-questions] but I’d like to show just the 2 or 3 lastest questions. Thank you!!!
replied 11 years ago
You can create a custom WP Query that pulls in the dwqa-question custom post-type.
We did this to add it to our home page loop:
function add_my_custom_post_types( $query ) {
if(is_front_page()) :
if ($query->is_main_query())
$query->set( ‘post_type’, array(‘post’,’dwqa-question) );
endif;
return $query;
}
add_action( ‘pre_get_posts’, ‘add_my_custom_post_types’ );
replied 11 years ago
That goes in your functions.php file