WordPress.org

Ready to get started?Download WordPress

Forums

Pronamic Google Maps
[resolved] Custom post types question (4 posts)

  1. zanzaboonda
    Member
    Posted 2 years ago #

    Okay, so I see in the description it says it works with custom post types. I'm not a coder; I only know a little bit. But if someone can point me in the right direction as to where to find the information, I would be so happy. :)

    I am currently using WP Business Directory Manager Plugin (http://businessdirectoryplugin.com/), which I really like except that they upgraded to these custom post types and now MapPress doesn't work with it anymore. :(

    So I'm just wondering how and where to implement the code provided for PGM to get it to work with the custom post type for WPBDMP.

    In the plugin's main .php file, I see this:

    register_post_type($wpbdmposttype,$args);

    But I honestly can't find a logical place where it seems like I should put the code (e.g., for the Google Maps Mashup):

    <?php
    
    if(function_exists('pronamic_google_maps_mashup')) {
        pronamic_google_maps_mashup(
            array(
                'post_type' => 'post'
            ) ,
            array(
                'width' => 300 ,
                'height' => 200 ,
                'map_type_id' => 'satellite' ,
                'marker_options' => array(
                    'icon' => 'http://google-maps-icons.googlecode.com/files/photo.png'
                )
            )
        );
    }
    
    ?>

    Can anyone tell me where I should put it or what I might be looking for?

    Thanks and best wishes,
    Kristen

    (I might be upgrading my WP installation later today.)

    http://wordpress.org/extend/plugins/pronamic-google-maps/

  2. Remco Tolsma
    Member
    Plugin Author

    Posted 2 years ago #

    Just go to the Pronamic Google Maps settings in your WordPress admin interface and activcate Google Maps for you custom post types. You only have to check an checkbox to activate Google Maps for custom post types.

  3. zanzaboonda
    Member
    Posted 2 years ago #

    Hi Remco-

    Thank you for the prompt response!

    And brilliant, thanks. :)

    I'm still a little confused on one point, though. Do I still need to add that code in somewhere? I did the checkbox and it displays fine in the editor, but not upon publishing.

    I read the other post about it not showing up and tried to add the code to the loop.php file beneath the <?php the_content(); ?> code and

    pronamic_google_maps(array(
    	'width' => 290 ,
    	'height' => 200
    ));

    beneath the get_template_part('content', 'page');.

    But neither of these seemed to work, so I deleted them again...

    Is there something I am missing? So sorry to be a bother.

    Thanks again and best wishes,
    Kristen

  4. Remco Tolsma
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, you also need to add code somewhere: http://wordpress.org/extend/plugins/pronamic-google-maps/installation/

    De adjustment you describe should normally work correct. You could try to add the following code to your functions.php file:

    <?php
    
    if(function_exists('pronamic_google_maps')) {
        function custom_pronamic_google_maps_the_content($content) {
            $content .= pronamic_google_maps(array(
                'width' => 500 ,
                'height' => 500 ,
                'echo' => false
            ));
    
            return $content;
        }
    
        add_filter('the_content', 'custom_pronamic_google_maps_the_content', 9);
    }
    
    ?>

    If that is also not working you should check if you have an wp_header() functioncall in header.php and an wp_foot() function call in footer.php. Otherwise you could pass us an URL of an page where the map is not showing up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic