WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
Customizing List Marker output (4 posts)

  1. turkmandu
    Member
    Posted 1 year ago #

    Ian--

    Love the plugin! I just need to tweak the shortcode-bgmp-list-marker.php code so that the links in the list go to the Placemark page.

    Right now I'm using this code:

    <li class="<?php esc_attr_e( self::PREFIX ); ?>list-item">
    	<div class="<?php esc_attr_e( self::PREFIX ); ?>list-placemark-title">
    		<a href="<?php echo apply_filters( 'the_permalink', $p->post_title ); ?>"><?php echo apply_filters( 'the_title', $p->post_title ); ?></a>
    	</div>
    </li>

    The only problem with this is when I have a Placemark title with spaces between the words, i.e. Dominican Republic. This creates

    <a href=Dominican Republic>Dominican Republic</a>

    Obviously, that won't work ... how would I edit my code string using the permalink in order to write a good link?

    Thanks in advance for any help you can provide.

    Matt

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

  2. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Matt, if you want the link to go to the Placemark's permalink, then I would just do this:

    <a href="<?php echo get_permalink( $p->ID ); ?">
        <?php echo apply_filters( 'the_title', $p->post_title ); ?>
    </a>

    Right now you're running the post title through the the_permalink filter, which doesn't make any sense to me.

  3. turkmandu
    Member
    Posted 1 year ago #

    Thanks Ian--

    I'd written and re-written those strings so many times I lost track. There is a closing bracket missing in your string

    <a href="<?php echo get_permalink( $p->ID ); ?>">
    	<?php echo apply_filters( 'the_title', $p->post_title ); ?>
    </a>

    Thanks for getting back to me -- even with such a minor question -- much appreciated.

  4. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    Awesome, thanks for fixing that error. That'll help anyone who comes along this thread in the future.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.