Viewing 15 replies - 16 through 30 (of 49 total)
  • Raj-can you post a link to your site?

    Hi,
    I’m having loading timeline… msg endlessly?
    I’ve installed json API plugin, added the timeline.php above script in the controller folder,
    added the shortcode in my blog template but it seems to be in conflict with something…
    Could it work if beeing in a post I put this post at bottom with a pullout plugin?
    Thanks,
    Janay

    http://conexion.cluster003.ovh.net/blog/welcome/

    I also had similar problems by installing the Timeline. But everything works finde now. I can not exactly remember how i solved the problems, but i can give you some basic hints to figure it out by yourself.

    Hi,
    Doesn’t work in wp page neather… :/
    http://conexion.cluster003.ovh.net/blog/timeline/
    [timeline src="http://conexion.cluster003.ovh.net/blog/api/timeline/category_posts/"] is in my page, timeline.php in json controller folder. What am I missing?
    I’m in multisite, does it matter for this plugin?
    Thanks for help,
    Janay

    @ kn1g,
    Thanks a lot for your answer!!! XD

    2)I’ve looked as you say @ http://conexion.cluster003.ovh.net/blog/api/timeline/category_posts/
    it says :
    {“status”:”error”,”error”:”Unknown controller ‘timeline’.”}
    so you’re right the controller seems not to work. Honestly I didn’t knew Json or API (not even sure how it works…), I’ve just pasted the code above in a php file and uplaoded it in json/controller folder. Json plugin is activated. I don’t know what else to do… :/ Can you help me figure out what I’m missing?

    3) I do have only posts no custom post types you can see all of them here : http://conexion.cluster003.ovh.net/blog/welcome/ and event posts here : http://conexion.cluster003.ovh.net/blog/news/

    As you can see I’m a french dancer and graphic designer but no developper…
    Thanks,
    Janay

    @ kn1g
    XD I found the solution : I just forgot to activate the timeline controller in WP Json plugin!!!
    It works know…!!!

    Just another question :
    I’ve got a custom field called ‘_datepicker’ for my posts in News category.
    How could I intégrate them in the query so The News posts will be sorted by datepicker date and other posts by normal date all in the same timeline?
    Thanks a lot for your help!!!
    Janay

    Hi,
    How can I add custom fields to the timeline controller as get_post_meta doesn’t work here :

    • add venue field ‘event_lieu’
    • replace post date with custom ‘_datepicker’ date field
    • have the title as a link to the corresponding post (permalink?)

    Hope someone could help!

    Thanks,
    Janay

    Hey, custom fields are a bit tricky.
    I give you an example how i did it:

    • 1. Define a custom field. Lets name it “example” (You do this by editing the post in the WP-Backend)
    • 2. Add a line to the timline controller php (timeline.php) like:
      $example = get_post_meta($main_post->ID, "example", true); (thats for the main post – modifiy for other posts!). Add it BEFORE the $json['timeline'] = array();
    • 3. Replace the Json variable you want to change. For example:
      $json['timeline']['startDate'] = $example;

    That should work! I also have some problems with the timeline. Im currently trying to figure out, how to stick the main post always to the current date. I want to have past posts and future posts…
    Anyway, i hope i could help you Janay! If not i can upload my code to pastebin. Just let me know!

    Hi kn1g,
    Thanks a lot for your answer. I already have my custom fields and used them in template. I’ve tried get_post_meta with json but not BEEFORE the $json[‘timeline’] = array(); if I remember ok. It didn’t work out but I’m gonna try your suggestion and let you know.
    I’ll be interested too to have a main post introducing actual season with past and future posts… let me know. If I found something that might help I’ll tell you.
    Thanks,
    Janay

    Hi kn1g,
    I’ve made it work for my custom date field now : Thanks a lot to YOU!!!
    But I don’t know how to add my 2 custom text fields :
    I’ve tried this :

    $json['timeline']['date'][$i]['startDate'] = date_i18n('Y,m,d', strtotime(get_post_meta($post->ID, "_datepicker", true)));
    					$json['timeline']['date'][$i]['endDate'] = date_i18n('Y,m,d', strtotime(get_post_meta($post->ID, "_datepicker", true)));
    					$json['timeline']['date'][$i]['headline'] = $post->post_title;
    					$json['timeline']['date'][$i]['lieu'] = $eventlieu;
    					$json['timeline']['date'][$i]['text'] = $post->post_excerpt;
    					$json['timeline']['date'][$i]['type'] = $eventtype;

    but ‘lieu’ and ‘type’ doesen’t show. Maybe I should concatenate them with div’s in ‘text’. Do you know how I could concatenate them with div’s separating?
    Thanks,
    Janay

    Sorry I forgot,
    I wanted the title in timeline to be a link to corresponding post, do you know how I could achieve this?
    Janay

    answered for title link:
    $json['timeline']['date'][$i]['headline'] = '<a href="'.get_permalink($post->ID).'">'.$post->post_title.'</a>';

    @miguel Peixe
    problems retrieving data from Advanced Custom Field checkbox (with multiple checks possible) whatever I try `if(is_array($eventtypes)) {
    foreach ($eventtypes as $key => $eventtype) {
    $typelist .= $eventtype . ‘| ‘;
    }
    $typelist = substr($typelist, 0, -2);` or implode() etc still output :
    Array ???
    Does somedody can help?
    Janay

    hi janay,

    i think the problem with more custom fields is complicated. Because i think, that you cant solve this in the “timline.php” alone. The timeline.php just outputs the values. To check if the values are outputted correct, check the controller output as i posted above. (I think this will work correctly) – If your custom fields are outputted correct by the controller. The job of the “timeline.php” is done.
    Now you need to get deeper into the code. Can’t help you there at the moment.

    Janay,
    I’m still not totally sure what you’re trying to do, but here’s how I got ACF to work:

    http://pastebin.com/emLGgGpD

    @kn1g and @empireoflight
    Yes that’s what I’ve done all the night (I could retrieve ACF date and text field easily with get_post_meta but checkbox options were a stop) and finally have found the solution use get_field instead of get_post_meta() or get_post_custom() to have the correct detailed output of my custom checkbox field (not Array). Would have be cool to use those checkbox values as timeline tag but for now I’m pretty satisfied and tired. It’s a first for me with JSON and with API…
    Here’s my code if anybody needs it : http://pastebin.com/s3sEcw7M

    Now I only need like kn1g to find how to set a
    Start Date (ex: main post -1 year) – Main Post Date – End Date (ex: main post +1 year) as I need to show past season AND current or future season events and have a main post introducing current season…
    If it’s not possible at least beeing able to start from end event would do it…
    If somebody has a start I’m eager to see it.

Viewing 15 replies - 16 through 30 (of 49 total)
  • The topic ‘[Plugin: Verite Timeline] Getting WordPress posts into Timeline’ is closed to new replies.