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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.