Hi Carl,
Thank you for your question.
[wdgpo_activities limit=’9′ template=’template’] and I have the template file: wdgpo-activities-template.php which works ok.
You will need to have a file named wdgpo-activities-TEMPLATE.php (where TEMPLATE is the value of this argument) in your theme directory.
Kind Regards,
Hi,
Thanks for getting back to me. I have the code above…and the template file in my folder. It is definatly loading the wdgpo-activities-TEMPLATE.php page. I know this because in my template I put some text and this shows up ok.
Sorry, my question was not really clear. What code do I need in the wdgpo-activities-TEMPLATE.php file to make the posts appear? I tried copying the whole of your activities.php in there but it shows nothing? Do you have a sample wdgpo-activities-TEMPLATE.php that I could use please?
Thanks again
Carl
Hi Carl,
Could you please try using the following code in your template file?
$query = new WP_Query(array(
'post_type' => array('post', 'wdgpo_imported_post'),
'meta_key' => 'wdgpo_gplus_feed_id',
'meta_value' => $feed_id,
'posts_per_page' => (int)$limit,
));
echo "<ul class='wdgpo_gplus_posts'>";
foreach ($query->posts as $post) {
$url = ('wdgpo_imported_post' == $post->post_type) ? get_post_meta($post->ID, 'wdgpo_gplus_item_id', true) : get_permalink($post->ID);
echo "<li>";
echo '<a class="wdgpo_gplus_post_title" href="' . esc_url($url) . '">' . esc_html($post->post_title) . '</a>';
echo "</li>";
}
echo "</ul>";
Best Regards,
Hi,
That is perfect. Thank you for letting me know. It’s not 100% clear what is needed from the docs but putting this in my templates works perfectly.
Cheers,
Carl
Hi Carl,
You are most welcome, if I can be of any further assistance please don’t hesitate to ask 🙂
It needs basic WP_Query loop to display Google plus activities.
Cheers.