pjeaje

How to list all tags except the current tag in tag.php

Dec 22nd, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.70 KB | None | 0 0
  1.  <?php
  2.  $queried_object = get_queried_object();
  3.  var_dump( $queried_object );
  4.  ?><?php
  5. /**
  6.  * The template for displaying Archive pages.
  7.  *
  8.  * Learn more: http://codex.wordpress.org/Template_Hierarchy
  9.  *
  10.  * @package GeneratePress
  11.  */
  12.  
  13. // No direct access, please
  14. if ( ! defined( 'ABSPATH' ) ) exit;
  15.  
  16. get_header(); ?>
  17.  
  18.     <section id="primary" <?php generate_content_class(); ?>>
  19.         <main id="main" <?php generate_main_class(); ?>>
  20.         <?php do_action('generate_before_main_content'); ?>
  21.         <?php if ( have_posts() ) : ?>
  22.  
  23.             <?php /**** do_action( 'generate_archive_title' ); ****/ ?>
  24.             <h1 class="entry-title" itemprop="headline"><?php single_tag_title(); ?> mining consultant in Western Australian</h1>
  25.  
  26.             <?php /* Start the Loop */ ?>
  27.             <?php while ( have_posts() ) : the_post(); ?>
  28.  
  29. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>>
  30.     <div class="inside-article">
  31.         <?php do_action( 'generate_before_content' ); ?>
  32.         <header class="entry-header">
  33.             <?php do_action( 'generate_before_entry_title' ); ?>
  34.  
  35.             <?php do_action( 'generate_after_entry_title' ); ?>
  36.         </header><!-- .entry-header -->
  37.         <?php do_action( 'generate_after_entry_header' ); ?>
  38.        
  39.         <?php if ( true == generate_show_excerpt() ) : ?>
  40.             <div class="entry-summary" itemprop="text">
  41.                 <?php the_excerpt(); ?>
  42.             </div><!-- .entry-summary -->
  43.         <?php else : ?>
  44.             <div class="entry-content" itemprop="text">
  45.                 <?php /*** the_content(); ***/ ?>
  46.                
  47.  
  48. <p><img class="wp-image-497 size-large aligncenter" src="https://globalthe.com/wp-content/uploads/2017/12/IGMS-mining-geological-engineering-5-1024x530.jpg" alt="<?php single_tag_title(); ?> mining consultant in Western Australian" height="530" width="1024">Integrated Geological Mining Services are <?php single_tag_title(); ?> mining consultants who provide integrated <a href="https://globalthe.com/mining-consultant/geological/">geological</a>, <a href="https://globalthe.com/mining-consultant/engineering/">engineering</a> and <a href="https://globalthe.com/mining-consultant/quality-health-safety-enviroment/">QHSE</a> services to the <?php single_tag_title(); ?> resource sector.</p>
  49. <p>Integrated Geological Mining Services work with an established network of industry leaders in <?php single_tag_title(); ?> mining to assist you all aspects of explorative <?php single_tag_title(); ?> mining operations that will take your project from discovery to delivery.</p>
  50. <p>Integrated Geological Mining Services are a passionate, tight knit and innovative consultancy with big capabilities. This culture ensures our client’s safely maximise the value and returns of their <?php single_tag_title(); ?> mining assets.</p>             
  51.  
  52. <?php              
  53. $tags = get_tags(array(
  54.     'exclude' => get_queried_object_id(),
  55. ));
  56. foreach($tags as $tag)
  57. {
  58.     echo '<a href="'.get_tag_link($tag->term_id);.'">'.$tag->name.'</a>';
  59.  
  60. }
  61. ?>
  62.            
  63. <?php /*** echo get_the_tag_list('<p>Other resources: ',', ','</p>'); ***/ ?>              
  64.                
  65.                 <?php
  66.                 wp_link_pages( array(
  67.                     'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
  68.                     'after'  => '</div>',
  69.                 ) );
  70.                 ?>
  71.             </div><!-- .entry-content -->
  72.         <?php endif; ?>
  73.        
  74.         <?php do_action( 'generate_after_entry_content' ); ?>
  75.         <?php do_action( 'generate_after_content' ); ?>
  76.     </div><!-- .inside-article -->
  77. </article><!-- #post-## -->
  78.  
  79.             <?php endwhile; ?>
  80.  
  81.             <?php generate_content_nav( 'nav-below' ); ?>
  82.  
  83.         <?php else : ?>
  84.  
  85.             <?php get_template_part( 'no-results', 'archive' ); ?>
  86.  
  87.         <?php endif; ?>
  88.         <?php do_action('generate_after_main_content'); ?>
  89.         </main><!-- #main -->
  90.     </section><!-- #primary -->
  91.  
  92. <?php
  93. do_action('generate_sidebars');
  94. get_footer();
Add Comment
Please, Sign In to add comment