• Resolved willmadd

    (@willmadd)


    Hi I need some help. I’ve recently changed wordpress theme which I believe is where the problem lies. Both my old and new theme allow the category description to appear on category pages in wordpress.

    Previously on my category pages I displayed a googlemap with with various locations using Google Maps CP. However now I have updated my theme I can not make your plugin show on my category pages.

    I can make your plug in show on normal pages and posts e.g

    https://www.curiousatlas.com/map-test/ (normal wordpress page)

    this page just has the short code

    [codepeople-post-map cat=“110″]

    However I put this on my category pages and nothing works. I can display other plugins using shortcode on my category pages e.g.

    https://www.curiousatlas.com/asia/sri-lanka/ (category wordpress page)

    The description for this category reads as per below:

    This is Code People Post Map:
    [codepeople-post-map cat=”110″]
    Hello this is a different Map from another plugin
    [show-map id=’2′]
    ?but as you can see from the link I sent [codepeople-post-map cat=“110″] does not appear on this page

    Do you have any suggestions?

    I really love your plugin and need to get this to work, I am a premium Google Maps CP
    user if that makes any difference
    Thanks in advance for your help – please let me know if this is not clear

    (just to add as well, these maps were displaying perfectly on category pages before i changed themes)

    William

    • This topic was modified 7 years, 5 months ago by willmadd.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @willmadd,

    Please, identify the template file used by your current theme to display the categories pages, and insert on it the shortcode with the piece of code below:

    <?php print do_shortcode('[codepeople-post-map]'); ?>

    Best regards.

    Thread Starter willmadd

    (@willmadd)

    Hi,

    I still can’t seem to get it to show. My current theme usese index.php to display it’s categories pages. I’ve included the php from my index.php file below with the <?php print do_shortcode('[codepeople-post-map]'); ?> inserted, but they still won’t show,

    Any ideas? Thanks in advance for your help,

    Kind regards

    William

    
    
    <?php get_template_part('templates/page', 'head'); ?>
    <?php if($pageTitle = ct_get_option('posts_index_page_title', '')):?>
    	<div class="patBlue">
    		<div class="container">
    			<h1 class="twoLines"><span><?php echo $pageTitle; ?></span></h1>
    		</div>
    	</div>
    <?php endif;?>
    <div class="patStd">
    	<div class="container">
    		<div class="row-fluid">
    
    //this is the line to display category description category page
    
    <?php echo category_description( $category_id ); ?> 
    <?php print do_shortcode('[codepeople-post-map]'); ?>
    
    			<?php if(is_404()):?><div class="span9"><?php else:?><div class="<?php ct_blog_index_class()?>"><?php endif;?>
    				<!-- blog left -->
    				<div class="rightPadd20">
    					<?php get_template_part('templates/content', get_post($post)?get_post_format():false); ?>
    				</div>
    				<!-- blogContainer -->
    			</div>
    			<?php if(ct_use_blog_index_sidebar()):?>
                    <div class="<?php roots_sidebar_class(); ?>">
    					<?php get_template_part('templates/sidebar'); ?>
    				</div>
    			<?php endif;?>
    		</div>
    		<!-- row-fluid -->
    	</div>
    </div>
    
    
    Thread Starter willmadd

    (@willmadd)

    I’ve been experimenting with the line of code you provided. That line of code means the map will only appear on first level categories e.g https://www.curiousatlas.com/europe and not second level e.g curiousatlas.com/europe/switzerland

    I also really need the ability to use a different map for each category – which <?php print do_shortcode('[codepeople-post-map]'); ?> dosn’t allow me to do.

    One further thing that happens, on the first level categories the map displays, but then if I add shortcode for my map in into the page as well, then the all maps disappear,

    Any ideas?

    Many thanks

    William

    Plugin Author codepeople

    (@codepeople)

    Hello William,

    In the template file it is easy to get the current category’s “ID”, to be used with the shortcode. A possible solution would be:

    <?php 
    $category = get_the_category(); 
    print do_shortcode('[codepeople-post-map id="'+$category[0]->cat_ID+'"]'); 
    ?>

    Best regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘making Google Maps CP appear in shortcode on category pages’ is closed to new replies.