Tell us what you are trying to do?
I succesfully included a view in a Buddypress template, except that I am not able to limit the number of items shown. In my content template I added [wpv-post-body view_template="loop-item-in-myview" limit="3"] but this does not work.
Is there any documentation that you are following?
https://toolset.com/forums/topic/using-view-shortcode-as-php/
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Hugo,
Thank you for getting in touch.
You are using the shortcode [wpv-post-body view_template="loop-item-in-myview" limit="3"] which is meant to display a post's content.
This means that it wont accept a limit attribute. The limit attribute is meant to be used on the view shortcode directly, here is an example below.
[wpv-view name="myview" limit="3"]
Please let me know if this clears things up for you.
Thanks,
Shane
OK, I see.
Can I also apply this limit in a php template like
echo render_view( array( 'name' => 'myview' ) );
?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Hugo,
Yes you can.
Just add it like this.
echo render_view( array( 'name' => 'myview' , 'limit'=>'3' ) );
Please let me know if this helps.
Thanks,
Shane
My issue is resolved now. Thank you!