WordPress.org

Ready to get started?Download WordPress

Forums

WP Geo
[resolved] Using the plugin with custom post types (6 posts)

  1. mamouneyya
    Member
    Posted 3 years ago #

    I feel lost with the little documentation available to this plugin. I want to implement geo-tagging for custom post type I've created. However, I cannot get this working.

    What I want:
    (1) The ability to geo-tag custom posts type called 'schools'.
    (2) The ability to display a map with all schools as markers, on some page.

    What I did:
    (1) Created a custom type for schools based on 'posts', using Custom Post Type UI plugin.
    (2) Checked this option to include the map with my schools type: http://grab.by/6Txr
    (3) Added some schools to my WordPress, and geo-tagged them.
    (4) Added the piece of code mentioned in this thread to the end of the file: /wp-geo/includes/shortcodes.php
    (5) Created a page called 'Map' and entered the shortcode: [wp_geo_mashup]

    Now I see the map on that page, but it's being displayed without any marker to the existed schools.

    Any help is highly appreciated.

  2. Ben Huson
    Member
    Plugin Author

    Posted 3 years ago #

    In the piece of code you added to /wp-geo/includes/shortcodes.php try changing the get_wpgeo_map() function to read as follows:

    get_wpgeo_map('numberposts=-1, post_type= schools');

  3. mamouneyya
    Member
    Posted 3 years ago #

    Unfortunately, it doesn't work :(
    The map is still being displayed without any marker.

  4. mamouneyya
    Member
    Posted 3 years ago #

    Ooh, finally I could figure it out. This works:
    get_wpgeo_map('numberposts=-1 && post_type= schools');

  5. Ben Huson
    Member
    Plugin Author

    Posted 3 years ago #

    Sorry, yes it should be:

    get_wpgeo_map('numberposts=-1&post_type= schools');

    or:

    get_wpgeo_map(array('numberposts'=>-1, 'post_type'= >schools));

  6. clickgnosis
    Member
    Posted 3 years ago #


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags