Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

Susa38 on "[Plugin: All-in-One Event Calendar] Custom MySQL query?"

$
0
0

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


Viewing all articles
Browse latest Browse all 5527

Trending Articles