Forum Replies Created

Viewing 15 replies - 16 through 30 (of 53 total)
  • Thread Starter Susa38

    (@susa38)

    About ajax pagination (question 3)
    When the post show they show with a ajax request?
    I do not want ajax request. Visual composer grid use ajax request and all the post images are showed at the same time and then the page loads very slow.

    I expect that with content views I could solve this.

    Thread Starter Susa38

    (@susa38)

    Thanks a lot.
    I go to study the links but I think the solutions of them are not ok. They are 3 years old and all in one event calendar changed the code and now is more complicated.

    Thread Starter Susa38

    (@susa38)

    thanks a lot.
    So I go to investigate if someone got to show all in one event calendar events or if someone can help to create this custom code.
    But I think it’s not an easy way. I think on all in one event calendar do not want that the people use other ways to show the events. I’ve been investigating so time but always I see problems.
    If I get it I’ll comment here. thanks

    Thread Starter Susa38

    (@susa38)

    Thanks for you answwer.
    Sorry but I’ve tested differents ways to show the events from all in one event calendar and I think It’s not like you comment.
    I’would be interested on the premium version of course but I would like to be sure that with post grid I can show all in one event calendar events and order them by start date (the post grid do not show past events. I mean order by start date begining from today)

    Sorry but I’m not sure because when I edit an event I do not see the meta_key that you comment. I think that all in one event calendar use a different way to select the start date.

    Do you know someone that have used post grid with all in one event calendar?

    For me do not work. thanks
    I think all in one event calendar use othe tag element

    here I see they use ‘tag_ids’ => array ( 29 )

    https://gist.github.com/lukaspawlik/045dbd5b517a9eb1cf95

    But I can not get.
    I do not know why all in one event calendar make so dificult to work with it.

    Sorry. I go to try your last message. I did not see before I wrrote

    Do not work

    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tags=destacados

    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tag=destacados

    Thanks Sharon

    I’ve tested

    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tag_ids=2368
    
    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tags_ids=2368
    
    post_type=ai1ec_event&post_status=publish&posts_per_page=6&ai1ec tag_id=2368
    
    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tags=2368
    
    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tag=2368
    
    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tags="2368"
    
    post_type=ai1ec_event&post_status=publish&posts_per_page=6&tag="2368"

    With the last 4 querys the post grid does not show nothing
    With the 3 first querys the post grid show the events but not from the tag number. Also I would like to order them by start date.

    Sorry Sharon

    I use visual composer plugin to create my pages.
    In this plugin I have the possibility to show a post grid with custom post.

    So I can show the events calendar from one category.

    The problem is that I can order the events by id, created date, modified date… but not by start date.

    On the plugin I can create also a custom query to show the grid.

    do you know how to make a custom query to show events with tag “mytag” and order them by start-date?

    For example when I insert on the custom query box this query I get 6 events

    post_type=ai1ec_event&post_status=publish&posts_per_page=6

    But I can’t get how to show only the events with the tag “mytag” and order them by start day and not by created day or modify day…

    I’ve tested with ai1ec tag_id=”20″ or tag_ID=”20″ or ai1ec tag_name=”mytag”

    Do you have an example of custom query than you have tested to show one tag and order by start date?

    When I try to get the start date with

    $instance->get( 'start' );

    I get something like this

    2016-03-08T14:15:00+01:00

    How could I get it like?
    Monday 8 march. 14:15 h.

    Sorry. The article of lukaspawlik is this
    https://gist.github.com/lukaspawlik/045dbd5b517a9eb1cf95

    Yes. I get it. thanks a lot Sharon for your help.
    I thought I was not possible for me. thanks.

    I say what I made.
    I find that with this code I could not get the post_id

    $post_name = $instance->get( 'post' )->post_id;

    So I found that this works ok.

    $post_id = $instance->get( 'post_id' );

    also I inserted this

    $thumbnail_image = get_the_post_thumbnail($post_id, 'the_post_thumbnail()');

    and call the image $thumbnail_image

    Ok then. this is to get the title, image(original size) and read more link

    foreach ( $date['events']['notallday'] as $instance ) {
    				$post_title   = $instance->get( 'post' )->post_title;
    				$post_name    = $instance->get( 'post' )->post_name;
    				$post_id = $instance->get( 'post_id' );
    				$thumbnail_image = get_the_post_thumbnail($post_id, 'the_post_thumbnail()');
    				$instance_id  = $instance->get( 'instance_id' );
    				$content     .= '<div class="hp-event">
    					<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    					.$post_title.'</a><br />'.$thumbnail_image.'<br/><a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    					</div><br/><br/>';
    		}

    and this is to get a diferent size created on functions file on the theme

    foreach ( $date['events']['notallday'] as $instance ) {
    				$post_title   = $instance->get( 'post' )->post_title;
    				$post_name    = $instance->get( 'post' )->post_name;
    				$post_id = $instance->get( 'post_id' );
    				$thumbnail_image = get_the_post_thumbnail($post_id, 'mycustomsize');
    				$instance_id  = $instance->get( 'instance_id' );
    				$content     .= '<div class="hp-event">
    					<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    					.$post_title.'</a><br />el post id'.$post_id.'<br/>el instance id'.$instance_id.'<br />el thumbnail image'.$thumbnail_image.'<br/><a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    					</div><br/><br/>';
    		}

    thanks a lot to Sharon Murphy for your help and also to lukaspawlik that made this article:

    https://gist.github.com/lukaspawlik/c4a0e605414542e844dd

    7 message up you can see all the steps (only you have to change the elements that I comment on this message)

    Yabadabadoooooooooo

    if I insert
    $post_id = $instance->get('post')->post_id;

    and after I insert
    get_the_post_thumbnail($post_id, 'single-post-thumbnail');

    it does not show nothing

    if I insert $post_id to print the post_id it does not show nothing

    foreach ( $date['events']['notallday'] as $instance ) {
    				$post_title   = $instance->get( 'post' )->post_title;
    				$post_name    = $instance->get( 'post' )->post_name;
    				$post_id = $instance->get('post')->post_id;
    				$instance_id  = $instance->get( 'instance_id' );
    				$content     .= '<div class="hp-event">
    					<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    					.$post_title.'</a><br />'.$post_id.'<br /><a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    					</div>';
    		}

    But if I insert instance_id it print it

    foreach ( $date['events']['notallday'] as $instance ) {
    				$post_title   = $instance->get( 'post' )->post_title;
    				$post_name    = $instance->get( 'post' )->post_name;
    				$post_id = $instance->get('post')->post_id;
    				$instance_id  = $instance->get( 'instance_id' );
    				$content     .= '<div class="hp-event">
    					<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    					.$post_title.'</a><br />'.$instance_id.'<br /><a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    					</div>';
    		}

    so I tried changing the post_id with your way get_the_post_thumbnail($post_id, ‘single-post-thumbnail’);
    and then it show to me one image but from one normal post (not all in one event calendar) and only one image. Not one image for each event.

    foreach ( $date['events']['notallday'] as $instance ) {
    				$post_title   = $instance->get( 'post' )->post_title;
    				$post_name    = $instance->get( 'post' )->post_name;
    				$post_id = $instance->get('post')->post_id;
    				$instance_id  = $instance->get( 'instance_id' );
    				$content     .= '<div class="hp-event">
    					<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    					.$post_title.'</a><br />'.$instance_id.'<br />'.get_the_post_thumbnail($instance_id, 'single-post-thumbnail').'<a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    					</div>';
    		}

    Thanks Sharon
    I’m working with your solution but I do not get nothing yet.

    you say “Set the post ID to $post_id inside your function”
    I’m not sure where I have to make that.
    I continue trrying with your solution to see if I get it.

    On my other proves…

    On the function the code get the elements like this

    $post_title = $instance->get( 'post' )->post_title;

    also I try with

    $singleee = $instance->get( 'post' )->single-post-thumbnail;

    or

    $singleee = $instance->get( 'post' )->the_post_thumbnail;

    But I do not get nothing. I think that the problem is how all in one event calendar get the image.

    I continue trying to get it.

    Sorry but i’m working it on local mode
    But this is the way:

    I create a file named ai1ec-sample-usage.php
    and I insert it on my theme folder

    on this file I insert this code:

    <?php
    // inicio funcion eventos en home
    function ai1ec2_display_events_func( $atts ) {
    	global $ai1ec_registry;
    	$content         = '<div id="content2"><img src="/wp-content/themes/scio/images/events-header.png" alt="" />';
    	$time            = $ai1ec_registry->get( 'date.system' );
    	// Get localized time
    	$timestamp       = $time->current_time();
    	// Set $limit to the specified categories/tags
    	$limit           = array(
    		//
    		// this is demo data - please use your own filters
    		//
    		'tag_ids' => array (2368)
    	);
    	$events_per_page = 10;
    	$paged           = 0;
    	$event_results   = $ai1ec_registry->get( 'model.search' )
    		->get_events_relative_to(
    			$timestamp,
    			$events_per_page,
    			$paged,
    			$limit
    		);
    	$dates = $ai1ec_registry->get(
    			'view.calendar.view.agenda',
    			$ai1ec_registry->get( 'http.request.parser' )
    		)->get_agenda_like_date_array( $event_results['events'] );
    	foreach ( $dates as $date ) {
    		foreach ( $date['events']['allday'] as $instance ) {
    			$post_title   = $instance->get( 'post' )->post_title;
    			$post_name    = $instance->get( 'post' )->post_name;
    			$instance_id  = $instance->get( 'instance_id' );
    			$content     .= '<div class="hp-event">
    				<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    				.$post_title.'</a><br /><a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    			</div>';
    		}
    		foreach ( $date['events']['notallday'] as $instance ) {
    				$post_title   = $instance->get( 'post' )->post_title;
    				$post_name    = $instance->get( 'post' )->post_name;
    				$instance_id  = $instance->get( 'instance_id' );
    				$content     .= '<div class="hp-event">
    					<a href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">'
    					.$post_title.'</a><br /><a class="read-more-link"  href="ai1ec_event/'.$post_name.'/?instance_id='.$instance_id.'">read more</a>
    					</div>';
    		}
    	}
    	$content .= '</div>';
    	return $content;
    }
    add_shortcode( 'display_events2', 'ai1ec2_display_events_func' );
    // fin funcion eventos en home
    ?>

    after I create a page template on my theme and I use it to make on wordpress a page,

    on the page template I insert

    <div class"own-event">
               <?php include 'ai1ec-sample-usage.php'; ?>
                <?php
    echo do_shortcode( '[display_events2]' );
    ?>
    </div>

    the on the fronend I can see the result:

    this is one event title -Madrid-
    read more
    this the second event title -Madrid-
    read more
    this the 3 event title -Barcelona-
    read more
    this the 4 event title -Madrid-
    read more
    this the 5 event title -Barcelona-
    read more

    And I would like to show also the post_thumbnail

Viewing 15 replies - 16 through 30 (of 53 total)