Member
Member
Tapkol   2014-07-31, 12:40
#1

Hello there,

In creating my site, I want a code for weeks and I can not find: I want a code or function that allows me to display the last article (only the last article) of a class.

To display a page in the last article with his text, images, etc. ..

Thank you for your help!

Bonjour,

Dans la création de mon site, je cherche un code depuis dès semaines et je ne trouve pas : je cherche un code ou fonction qui me permet d'afficher le dernier article publié (seulement le dernier article) d'une catégorie.

Pour afficher dans une page le dernier article publié avec son texte, images, etc..

Merci de votre aide !

Administrator
Administrator
acrylian   2014-07-31, 14:19
#2

There are several ways to do that. You can use the template functions:
http://www.zenphoto.org/documentation/plugins/zenpage/_zp-extensions---zenpage---zenpage-template-functions.php.html#functionprintLatestNews
For more flexibility of own formatting (you will need the object model to work with the array it returns)
http://www.zenphoto.org/documentation/plugins/zenpage/_zp-extensions---zenpage---zenpage-template-functions.php.html#functiongetLatestNews

Or object model way directly using the class methods getArticles directly with:
http://www.zenphoto.org/documentation/plugins/zenpage/ZenpageCategory.html#methodgetArticles
or http://www.zenphoto.org/documentation/plugins/zenpage/Zenpage.html#methodgetArticle

If you want to get an article from a specific category use the same with a category object.

Recommended read: http://www.zenphoto.org/news/zenphotos-object-model-framework

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.