Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter mgrmn

    (@mgrmn)

    Any Help would be apreciated.

    fiddling around..

    I found that this actually kinda does what i need, however can somebody how I can access thubmnail & address of the location…

    function get_place_list($atts) {
    	extract( shortcode_atts( array('type' => ''), $atts ) );
    	$args=array(
    			'taxonomy' => 'places',
    			'term' => $type,
    			'post_type' => 'location',
    			'posts_per_page' => 10,
    			'caller_get_posts'=> 1
    	);
    	$my_query = null;
    	$my_query = new WP_Query($args);
    	if( $my_query->have_posts() ) {
    		  while ($my_query->have_posts()) : $my_query->the_post(); ?>
    		    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    		    <?php
    		  endwhile;
    		}
    	wp_reset_query();
    }

    Thank you so much

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Thread Starter mgrmn

    (@mgrmn)

    the_post_thumbnail shows thumbnail but… kinda funny

    My code

    if( $my_query->have_posts() ) {
    		while ($my_query->have_posts()) : $my_query->the_post();
    			$bloginfo = get_template_directory_uri();
    			$time = get_the_time(get_option('date_format'));
    	 		$permalink = get_permalink();
    			$title = get_the_title();
    			echo '<div class="entry clearfix"><div class="thumb_medium"><img src="'.the_post_thumbnail(array(150,150)).'" alt="'.$title.'"/></div><div class="post_content"><h2><a href="'.$permalink.'" rel="bookmark">'.$title.'</a></h2><p>[get Address of location ???]</p><div class="meta-box"><span>[get CONTENT EXCERPT of Location ??? ] </span></div></div></div>';
    		endwhile;
    	}
    	wp_reset_query();

    result: (see image https://postimg.org/image/rgjkyuei3/ )

    <p><img width="150" height="150" src="https://localhost/wp-content/uploads/2013/06/Location-Image-e1370844933939-150x150.jpg" class="attachment-150x150 wp-post-image" alt="Location Image" />
    <div class="entry clearfix">
    <div class="thumb_medium"><img src="" alt="Location 1"/></div>
    <div class="post_content">
    <h2><a href="https://localhost/?location=location-1"  rel="bookmark">Location 1</a></h2>
    Thread Starter mgrmn

    (@mgrmn)

    Fixed it using this,

    Now the only left me is to get the direccion info, and excerpt for content of the location ! (how do i access the other info of the location?)

    $bloginfo = get_template_directory_uri();
    			$time = get_the_time(get_option('date_format'));
    	 		$permalink = get_permalink();
    			$title = get_the_title();
    			$img_src = wp_get_attachment_image_src( get_post_thumbnail_id($GLOBALS['post']->ID), '');
    			echo '<div class="entry clearfix"><div class="thumb_medium"><img src="'.$bloginfo.'/scripts/timthumb.php?src='.$img_src[0].'&w=140&h=80&zc=1&q=100" alt="'.$title.'"/></div><div class="post_content"><h2><a href="'.$permalink.'" rel="bookmark">'.$title.'</a></h2><p>-----</p><div class="meta-box"><span>----</span></div></div></div>';

    Plugin Support angelo_nwl

    (@angelo_nwl)

    how about if you add/try something like this

    echo do_shortcode("[event post_id=".$post->ID."]#_LOCATIONEXCERPT[/event]");

    *replace $post->ID with your post id

    Thread Starter mgrmn

    (@mgrmn)

    Because its not for a listing of locations that have events, more having a page listing locations as in

    Lounges
    Discos
    Hoteles
    etc….

    Hiya!

    You could simply use the locations_list shortcode. See https://wp-events-plugin.com/documentation/shortcodes/ for more info.

    Phil

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Location category (list with thumbnails’ is closed to new replies.