Guest User

Untitled

a guest
Sep 22nd, 2022
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1.  
  2.                 $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  3.                
  4.                 if (strpos($url,'stage') !== false){
  5.                     the_content(
  6.                         sprintf(
  7.                             wp_kses(
  8.                                 /* translators: %s: Name of current post. Only visible to screen readers */
  9.                                 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'martitheme' ),
  10.                                 array(
  11.                                     'span' => array(
  12.                                         'class' => array(),
  13.                                     ),
  14.                                 )
  15.                             ),
  16.                             wp_kses_post( get_the_title() )
  17.                         )
  18.                     );
  19.                 }
  20.                 else{
  21.                
  22.                 $category = single_term_title("", false);
  23.                 $current_category_array = get_queried_object();
  24.                 $ID = $current_category_array->term_id;
  25.    
  26.  
  27.                 echo $category;
  28.                 echo $ID;
  29.            
  30.  
  31.  
  32.                 $args = array(
  33.                     'post_type' => 'etapi',
  34.                     'category_name'  => $category,
  35.                     'cat' => 46
  36.                 );
  37.                 $loop = new WP_Query($args);
  38.                
  39.                 while($loop->have_posts()): $loop->the_post();
  40.                 $title = the_title();
  41.                 $link = get_permalink( get_page_by_title( $title ) );
  42.                 ?>
  43.                 <div class="folderContainer">
  44.                 <a href="<?php echo $link; ?>"> <img src="http://localhost/marti/wp-content/uploads/2022/09/Folder-icon.png" alt="" class="folder hvr-float-shadow"> </a>
  45.                 </div>
  46.                 <?php
  47.                
  48.  
  49.                
  50.  
  51.                 endwhile;
  52.                 wp_reset_query();
  53.                 }
Advertisement
Add Comment
Please, Sign In to add comment