php code examples?
-
Hi, I have YARPP successfully installed on a development site and working fine for standard posts. I’ve been trying to find some reference material though for using php to do some customisations, but even with the readme.txt, a few examples in the forums, oh, and the Wordcamp presentation, I can’t seem to find anything that gives a noob like me the basics. For example what is the difference in use between related_posts() and yarpp_related()?
The use case that I have is that I want to display related posts for a specific post on a page, rather than the post itself. Both the source post and the related posts will be in a custom post type ‘objects’.
If I use
related_posts(array(), $postID, true);
this works for a standard post ID, but if change the ID to one for a custom post type it says no results (my default config displays both post types)So I then tried
related_posts((array(post_type(array(‘posts’,’objects’)), $postID, true);
but this returns no results at all, with an ID of either post type.Sorry, it may be a very basic mistake on my part, but I’d be grateful for any pointers. Thanks.
https://www.ads-software.com/plugins/yet-another-related-posts-plugin/
- The topic ‘php code examples?’ is closed to new replies.