-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display posts feature #10
Comments
Hi miguel ! Thank you very much for your great controller. However, I have a problem with dates of posts that seem doesn't work correctly, i don't know why. |
Hi kukrapoke, it looks ok, but all the events are on the same day. If you want to use custom dates (other than post publish date) I recommend using a custom meta to fill this data. Could be something like this: $json['timeline']['date'][$i]['startDate'] = date('Y,m,d', strtotime(get_post_meta($main_post->ID, 'start_date', TRUE)); |
Hi miguel, i showed your code to a friend who found an error, now everything is working properly. The error is line 68 and 69 : You need to replace $main_post by $post. |
Fixed it, thank you! |
hey all! got the JSON API plugin installed, and configured correctly, got the Verite plugin installed. Where I put this controller script? You guys are the best, this stuff is so good. |
sorry URL to project is here: Also, I've now tried dropping the script into the core.php file in the JSON plugin folder, even tried creating a timeline.php file and dropping in there. Still not working. Would love a little help. Thanks!!! |
Hi aaronsmulktis ! First you have to put the pastebin code into a file like timeline.php and save this file into /plugins/json-api/controllers/ After you need to activate this controller in the JSON API Settings in WP admin. To complete you have to paste your JSON API shorcode anywhere in your template like this : Voila ! |
Thanks so much for the quick help Miguel! When I inspect the element, the timeline-embed div is there, and I've deleted and reinstalled the plugin, but even when I specify the width/height in the short code (or php) nothing displays.. weeiirrddd |
also when I test the JSON API by clicking on my timeline controller "category_posts" link, it returns the correct data. so that should be working fine. just don't know why it isn't loading that data into the timeline. |
sorry thank YOU kukrapoke for the speedy help! :P |
Hey. Thanks for the awesome plugin. I was wondering how to add a photo credit to the json controller. I tried this:
But it doesnt work. The source outputs "asset":{"media":"URLToMedia","credit":["John Doe"]} why is it adding surrounding it with []? |
Hi LSDLTD, As you can see on get_post_meta function reference you should use get_post_meta($main_post->ID, 'user_submit_name', TRUE); to output a single value instead of an array. The third argument is set to false by default, to get an array of post metas. |
Ah! Thank you! |
Support posts to be displayed on the Timeline using JSON API wp plugin.
Use/improve this code for start:
http://pastebin.com/SwbT2J9A
The text was updated successfully, but these errors were encountered: