Jump to content

Simple array question.


daebat

Recommended Posts

I'm just installed Yet Another Featured Posts Plugin and it is working just fine but only outputting the title and text for my post.  I have a featured image and it claims to have the functionality to do so but I can't figure out the call to the data.  Here is what is provided in the documentation:

 

http://dev.jonraasch.com/yafpp/docs

 

For advanced users, YAFPP offers some useful output options which can be passed to the get_featured_posts() function like so:

 

<?php get_featured_posts(array( 'method' => 'return')); ?>

 

In this example we are setting YAFPP to return the formatted list of featured posts, as opposed to echoing it out like it does by default.

 

Additionally you can pass 'arr' to get YAFPP to return an array of data for the featured posts. The format for this array is a list of the posts, each of which contain these keys:

 

<?php

 

array(

    'id'      => '', // id of the post

    'title'  => '', // title of the post

    'excerpt' => '', // excerpt of the post

    'url'    => '', // the post permalink

    'image'  => '', // an array of data for a YAPB image, if it exists

    'author' =>  '', // the post's author

);

 

?>

 

 

Currently my code is very simple like this:

 

<?php get_featured_posts(); ?>

 

Thanks for the help!

Link to comment
https://forums.phpfreaks.com/topic/232678-simple-array-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.