• Hi Joe,

    It would be great if the collection pages showed the collection map as well as a list of all the routes within that collection.

    Either at the top so it’s easy to scroll past to see the list of routes. Or, in a similar way you can browse a list of properties or view a map on sites like Rightmove or Booking.com.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Joe

    (@morehawes)

    Hi @wkndwlk,

    Thanks for your suggestion. I have actually tried to add this to the plugin before!… but because of how themes treat the Collection archive pages I am yet to find a way to add this from the plugin.

    But you can achieve this through your theme like so:

    1. In your theme directory you should have an archive.php file that is responsible for how archive pages are displayed (it may be called something different like taxonomy.php).
    2. Create a copy of this file in your theme directory called taxonomy-waymark_collection.php
    3. Edit this file and add the following where you would like the Collection Shortcode to display:
      <?php echo do_shortcode('[Waymark collection_id="' . get_queried_object()->term_id . '"]'); ?>

    You can see an example of this here. I hope this helps.

    Cheers,

    Joe

    Thread Starter Dan

    (@wkndwlk)

    Thanks for your suggestion, however, it doesn’t seem to work for me. Any thoughts on where to paste the code:

    <?php
    
    get_header();
    
    
    
    /** Left sidebar */
    get_sidebar( 'left' );
    
    
    ?>
    
    	<main id="primary" role="main">
    		<?php
    		if ( have_posts() ) {
    			?>
    			<header class="page-header">
    				<?php
    				the_archive_title( '<h1 class="page-title">', '</h1>' );
    				the_archive_description( '<div class="archive-description">', '</div>' );
    				?>
    				
    			</header><!-- .page-header -->
    			<?php
    			/* Start the Loop */
    			while ( have_posts() ) {
    				the_post();
    				/**
    				 * Include the Post-Type-specific template for the content.
    				 * If you want to override this in a child theme, then include a file
    				 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
    				 */
    				get_template_part( 'template-parts/content', get_post_type() );
    			}
    
    			/**
    			 * Aeonblog_post_navigation hook.
    			 *
    			 * @since AeonBlog 1.0.0
    			 *
    			 * @hooked aeonblog_posts_navigation -  10
    			 */
    			do_action( 'aeonblog_action_navigation' );
    		} else {
    			get_template_part( 'template-parts/content', 'none' );
    		}
    		?>
    		
    
    		
    	</main><!-- #primary -->
    <?php
    get_sidebar();
    
    
    
    
    get_footer();
    
    Plugin Author Joe

    (@morehawes)

    Hi @wkndwlk,

    Try adding it after the header like this:

    </header><!-- .page-header -->
    
    <?php echo do_shortcode('[Waymark collection_id="' . get_queried_object()->term_id . '"]'); ?>
    
    <?php
    /* Start the Loop */

    I hope that helps.

    Cheers,

    Joe

    Thread Starter Dan

    (@wkndwlk)

    Nice one, thanks, That worked!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Collection pages to show collection map’ is closed to new replies.