Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter RobertBrisbane

    (@robertbrisbane)

    Thank you for your reply ??

    I got a solution from another forum and ended up with echo get_query_terms_list(); in my search template and placed the following in the functions.php

    function get_query_terms_list( $taxonomy = 'post_tag', $sep = ', ' ) {
        $list = array();
    
        foreach ( $GLOBALS['wp_query']->posts as $post ) {
            if ( is_array( $terms = get_the_terms( $post, $taxonomy ) ) ) {
                foreach ( $terms as $term ) {
                    // Set the term's initial count.
                    if ( ! isset( $list[ $term->term_id ] ) ) {
                        $list[ $term->term_id ] = 0;
                    }
    
                    // And then increment it for each post.
                    $list[ $term->term_id ]++;
                }
            }
        }
    
        // Sort by the count, highest to lowest.
        arsort( $list );
    
        $links = array();
    
        foreach ( $list as $term_id => $count ) {
            $term = get_term( $term_id );
            $link = get_term_link( $term );
    
            if ( ! is_wp_error( $link ) ) {
                $links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' .
                    $term->name . " (<b>$count</b>)" . '</a>';
            }
        }
    
        return implode( $sep, $links );
    }

    This worked really well ??

    Thank you again for you reply. It definitely made me think a bit more about the amount of queries to collect all the terms.

    Thread Starter RobertBrisbane

    (@robertbrisbane)

    Hi Chris,

    Thank you for the prompt responds. Much appreciated ??

    Thread Starter RobertBrisbane

    (@robertbrisbane)

    Hi Dylan,

    Thank you for your quick responds. This is amazing ?? Thank you so much. This was exactly what I was looking for and it works perfectly.

    I will tick this one as resolved.

    Thank you again ??

    Hi,

    I should probably add that the button works fine if I don’t log IP, Cookies or users. So it must be some sort of conflict with the log?!?

    Thanks ??

    Hi,
    same problem here. has anyone found a solution for this?
    thanks in advance ??

    Thread Starter RobertBrisbane

    (@robertbrisbane)

    ok so I’m working on it ??

    the solution is somewhere in here

    /**
    	 * A template tag to insert a link to a post on the mashup.
    	 *
    	 * @see show_on_map_link()
    	 */
    	public static function post_link($option_args = '') {
    		return self::show_on_map_link($option_args);
    	}
    
    	/**
    	 * A template tag to return an URL for the current location on the
    	 * global map page.
    	 *
    	 * @since 1.3
    	 * @todo What would happen if the global map is not a post map?
    	 *
    	 * @param string|array $args Template tag arguments.
    	 * @return string The URL, empty if no current location is found.
    	 */
    	public static function show_on_map_link_url( $args = null ) {
    		global $geo_mashup_options;
    
    		$defaults = array( 'zoom' => '' );
    		$args = wp_parse_args( $args, $defaults );
    
    		$args = array_filter( $args );
    
    		$url = '';
    		$location = self::current_location_guess();
    
    		if ( $location ) {
    			$url = get_page_link($geo_mashup_options->get('overall', 'mashup_page'));
    
    			if ( !$url )
    				return '';
    
    			$args['center_lat'] = $location->lat;
    			$args['center_lng'] = $location->lng;
    
    			if ( $geo_mashup_options->get( 'global_map', 'auto_info_open' ) == 'true' )
    				$args['open_object_id'] = $location->object_id;
    
    			$url = htmlentities( add_query_arg( $args, $url ) );
    		}
    		return $url;
    	}
    
    	/**
    	 * A template tag to insert a link to the current location post on the
    	 * global map page.
    	 *
    	 * @since 1.3
    	 *
    	 * @param string|array $args Tag arguments.
    	 * @return string The link HTML, empty if no current location is found.
    	 */
    	public static function show_on_map_link( $args = null ) {
    		$defaults = array( 'text' => __( 'Show on map', 'GeoMashup' ),
    			 'display' => false,
    			 'zoom' => '',
    			 'show_icon' => true );
    		$options = wp_parse_args($args, $defaults);
    		$link = '';
    		$url = self::show_on_map_link_url( $args );
    		if ( $url ) {
    			$icon = '';
    			if ($options['show_icon'] && strcmp( $options['show_icon'], 'false' ) != 0) {
    				$icon = '<img src="'.GEO_MASHUP_URL_PATH.
    					'/images/geotag_16.png" alt="'.__('Geotag Icon','GeoMashup').'"/>';
    			}
    			$link = '<a class="gm-link" href="'.$url.'">'.
    				$icon.' '.$options['text'].'</a>';
    			if ($options['display']) {
    				echo $link;
    			}
    		}
    		return $link;
    	}
    
    	/**
    	 * Visible posts list template tag.
    	 *
    	 * Returns a placeholder where a related map should display a list
    	 * of the currently visible posts.
    	 *
    	 * @since 1.2
    	 * @link https://code.google.com/p/wordpress-geo-mashup/wiki/TagReference#Visible_Posts_List
    	 *
    	 * @param string|array $args Template tag arguments.
    	 * @return string Placeholder HTML.
    	 */
    	public static function visible_posts_list($args = null) {
    		$args = wp_parse_args($args);
    
    		$list_html = '';
    
    		$for_map = 'gm-map-1';
    		if ( !empty( $args['for_map'] ) ) {
    			$for_map = $args['for_map'];
    		}
    		if ( !empty( $args['heading_text'] ) ) {
    			$heading_div = '<div id="' . $for_map . '-visible-list-header" style="display:none;">';
    			$heading_tags = '<h2>';
    			if ( !empty( $args['heading_tags'] ) ) {
    				$heading_tags = $args['heading_tags'];
    			}
    			$list_html .= balanceTags( $heading_div . $heading_tags . $args['heading_text'], true );
    		}
    		$list_html .= '<div id="' . $for_map . '-visible-list"></div>';
    		return $list_html;
    	}
    
    	/**
    	 * List located posts template tag.
    	 *
    	 * Returns an HTML list of all located posts.
    	 *
    	 * @since 1.1
    	 * @link https://code.google.com/p/wordpress-geo-mashup/wiki/TagReference#List_Located_Posts
    	 *
    	 * @param string|array $option_args Template tag arguments.
    	 * @return string List HTML.
    	 */
    	public static function list_located_posts( $option_args = null ) {
    		$option_args = wp_parse_args( $option_args );
    		$option_args['object_name'] = 'post';
    		$list_html = '<ul class="gm-index-posts">';
    		$locs = GeoMashupDB::get_object_locations( $option_args );
    		if ($locs) {
    			foreach ($locs as $loc) {
    				$list_html .= '<li><a href="'.get_permalink($loc->object_id).'">'.
    					$loc->label."</a></li>\n";
    			}
    		}
    		$list_html .= '</ul>';
    		return $list_html;
    	}
    Thread Starter RobertBrisbane

    (@robertbrisbane)

    Hi,

    I haven’t found a solution yet for fixing the lightbox problem but I found a work around. Not very elegant but it works. I simply call the post in an <object> within the geo-mashup-full-post.php or info-window.php.

    <object data=”<?php echo get_permalink(); ?>” style=”width: 600px; height:500px;”></object>

    This seems to work.

    Hi,

    I’m using $withcomments in a page that calls a post’s content. I’m using custom post types and enabled comments for each custom post type as well as ticked the boxes in the wpDiscuz settings.

    <?php
    global $withcomments;
    $withcomments = true;
    comments_template("comments.php");
    ?>

    I can load the normal comments.php fine but the wpDiscuz doesn’t load at all.

    Any thoughts?

    Thanks for your help ??

    Hi,
    I’m trying to do a similar thing but can’t get it to work.

    I have a post with children. I have a list (text and thumbnails) of the children displayed on the post site. I would like to display the current post as well as the posts children on the map.

    Can’t seem to get this to work. This is what I have so far:

    // children arguments:
            $post_children = array(
    	'post_type' => array ('my_custom_post_type'),
    	'posts_per_page' => -1,
    	'post_status' => 'publish',
    // parent page check
    	'post_parent' => $post->ID
    );

    next I’m trying to get it on to the map:

    echo GeoMashup::map('map_type=G_PHYSICAL_MAP&map_content=contextual&object_id='.$post_children);

    I just seem to not quiet understand something here it seems. Thank you for your help in advance.

    Hi,
    I just wanted to follow up on this thread and was wondering if there had been any progress?

    I found this snippet a while ago but it doesn’t quiet do the trick:
    https://wordpress.stackexchange.com/questions/44324/creating-new-page-with-pre-defined-parent-page

    also see:
    https://www.ads-software.com/support/topic/new-child-post-button-from-parent-post-without-using-attribute-drop-down?replies=1#post-5698454

    Thread Starter RobertBrisbane

    (@robertbrisbane)

    So I found this here, it assigns the category to the custom post type but the hierarchy for the parent child is still missing.

    function add_g_category_automatically($post_ID) {
    	global $wpdb;
    	if(!has_term('','category',$post_ID)){
    		$cat = array(4);
    		wp_set_object_terms($post_ID, $cat, 'category');
    	}
    }
    add_action('publish_my_post_type', 'add_g_category_automatically');

    any thoughts?

    Thread Starter RobertBrisbane

    (@robertbrisbane)

    Thank you for always replying this quickly, much appreciated. I will follow the feature request from now on ??

    Hi,

    I have the same question as ‘alejandronfb’:

    – a Text Function would be great
    – a Text Function allowing ‘Hyperlinks’ would be awesome, then it could be used as a tagging application for images with drawing capability.

    Congrats to a simple to use and very useful plugin, great stuff ??
    Thanks

    Thread Starter RobertBrisbane

    (@robertbrisbane)

    Thanx ??

    I’ll keep watching this space.

Viewing 15 replies - 1 through 15 (of 19 total)