• 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ian Dunn

    (@iandunn)

    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.

    Thread Starter turkmandu

    (@turkmandu)

    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.

    Plugin Author Ian Dunn

    (@iandunn)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing List Marker output’ is closed to new replies.