Created
August 4, 2015 07:33
-
-
Save bepatrickdavid/461553b118294d8d89be to your computer and use it in GitHub Desktop.
WP: bbPress from reply get forum ID dal reply prendere l'id del forum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $args = array( | |
'post_type' => 'reply', | |
'post_status' => 'publish', | |
'posts_per_page' => 3, | |
'order' => 'DESC', | |
'orderby' => 'date' | |
); | |
$the_query = new WP_Query( $args ); ?> | |
<?php if ($the_query->have_posts()) : ?> | |
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?> | |
<?php $parent = array_reverse(get_post_ancestors($post->ID));?> | |
<?php $forumID = $parent[0]; ?> | |
<?php endwhile ?> | |
<?php endif ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment