WP_Query: how to search tags in addition to a custom post type?

Below is what I have so far for a custom rest endpoint (‘placesdb/v1/search?term=’) for a custom post type (place). This successfully returns all the places that have the search term in the title or content. However, I also want to return all the tags (tag archive pages) that match the search term (the same result as calling the non-custom ‘/wp/v2/tags?search=’). Is it possible to somehow add the tag results to the place results? I already successfully did the front-end approach of calling the places and tags endpoints separately via ajax, but I would rather get all the data in one swoop. Hence my attempt at making this custom endpoint.

function placesSearch() {   register_rest_route('placesdb/v1', 'search', array(     'methods' => WP_REST_SERVER::READABLE,     'callback' => 'placesSearchResults'   )); } function placesSearchResults($  data) {   $  places = new WP_Query(array(     'post_type' => array('place'),     's' => sanitize_text_field($  data['term'])   ));    $  placesResults = array();    while($  places->have_posts()) {     $  places->the_post();     array_push($  placesResults, array(       'title' => get_the_title(),       'permalink' => get_the_permalink()     ));   }    return $  placesResults; } add_action('rest_api_init', 'placesSearch'); 

limit number of tags shown in tag.php

Been hitting a nail with this one as i’m very amateur with php. I have a loop in tag.php but it shows all posts with that tag – how can I limit the number to say, 5?

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>     <h2 align="center">  <a href="<?php echo get_permalink() ?>"> <?php the_title(); ?>  </a> </h2>     <?php the_content(); ?>     <?php endwhile; else: ?>     <h2>Woops...</h2>     <p>Sorry, no posts we're found.</p>     <?php endif; ?> <?php wp_reset_query(); ?>  

Do rel canonical tags permanently affect link juice, or can they be undone later?

Does placing the rel=canonical tag pass the link juice to the canonicalised page forever? What I’m trying to say is, if one were to canonicalise page b to page a, would then reverting that change (for turning it into its own page lets say) leave some link juice and hence ranking "power" behind on page a or would b simply retain all that it had transferred via the canonicalisation signal it had sent to Google?

How to display products sort by Tags for Woocommerce

I have tried to display products by tags on shop page, i found this code and it workes perfectly

            $  args = array(                 'number'     => $  number,                 'orderby'    => 'title',                 'order'      => 'ASC',                 'hide_empty' => $  hide_empty,                 'include'    => $  ids             );             $  product_tags = get_terms( 'product_tag', $  args );             $  count = count($  product_tags);             if ( $  count > 0 ){                 foreach ( $  product_tags as $  product_tag ) {                     echo '<h4>' . $  product_tag->name . '</a></h4>';                     $  args = array(                         'posts_per_page' => -1,                         'tax_query' => array(                             'relation' => 'AND',                             array(                                 'taxonomy' => 'product_tag',                                 'field' => 'slug',                                 // 'terms' => 'white-wines'                                 'terms' => $  product_tag->slug,                                 'product_tag'=> "latest-product"                             )                         ),                         'post_type' => 'product',                         'orderby' => 'title,'                     );                     $  products = new WP_Query( $  args );                     woocommerce_product_loop_start();                     while ( $  products->have_posts() ) {                         $  products->the_post();                         do_action( 'woocommerce_shop_loop' );                         wc_get_template_part( 'content', 'product' );                         ?>                                                      <?php                     }                     woocommerce_product_loop_end();                 }             }          ?> 

But when I tried to filter resaults it wont apply filters, by the way i m using Annasta Filter Plugin

1

Display Custom Fields Meta Box on Category, Tags and CPT

I want to Add Custom Field on All Tags, Category and Custom Post Type (Taxonomy) but with below code get custom field option only on All Category. How to get on All Tags, Categories and CPT Taxonomy as well?

function wecode_category_fields($  taxonomies) {          if (current_filter() == 'category_edit_form_fields') {               $  Pincode = get_term_meta( $  taxonomies->term_id, 'Pincode', true );               ?>                  <tr class="form-field">         <th valign="top" scope="row"><label for="Pincode"><?php _e('Pincode'); ?></label></th>            <td>               <input type="text" size="40" value="<?php echo esc_attr( $  Pincode ) ? esc_attr( $  Pincode ) : ''; ?>"  name="Pincode"><br/>                   <span class="description"><?php _e('Please enter your Pincode'); ?></span>            </td>         </tr>                     <?php } elseif (current_filter() == 'category_add_form_fields') {             ?>              <div class="form-field">                 <label for="Pincode"><?php _e('Pincode'); ?></label>                 <input type="text" size="40" value=""  name="Pincode">                 <p class="description"><?php _e('Please enter your Pincode'); ?></p>             </div>                 <?php         } }          add_action('category_edit_form_fields', 'wecode_category_fields', 10, 2);     add_action('category_add_form_fields', 'wecode_category_fields', 10, 2);           function wecode_save_category_fields($  term_id) {         if ( isset( $  _REQUEST['Pincode'] ) ) {              $  Pincode = $  _REQUEST['Pincode'];                                   update_term_meta( $  term_id, 'Pincode', $  Pincode );            }  }     add_action('edited_category', 'wecode_save_category_fields', 10, 2);     add_action('create_category', 'wecode_save_category_fields', 10, 2);  

Using dynamic tags within text

So I created some dynamic tags. After my Gravity Form is submitted it creates a post. The post has the contents of the dynamic tags listed under the body so this is all working fine. The question is, can I insert a dynamic tag within other text? For example, I have a dynamic tag called "author" and "publishing_date". In my body of text, I want to use the sentence "The book was written by {dynamic tag author} in {dynamic tag publishing_date}.

How can i make anchor tags clickable when using the function z index

the nav is set absolute to the headerContainer. And in motion it works fine. It needs to drop from behind the headerContainer over the main content of the page. This way the content dissapears and the menu is on top. I have done so by setting my main class to relative and a negative z-index: 2; because the nav is set to negativ -1;

Right now everything works and it looks good. The only problem is that the anchor tags inside my nav are not clickable anymore.

I have been searching for the answer but could not find anything related. Is there anyone who can tell me why this occurs? I have yet to find a good solution for this.

What i want to happen seems so simple.. it needs to drop down from behind or at least create the idea its coming from behind the header..

I have tried setting the height of the nav to 0 and on click set it to 100%. That wil drop the menu as if it comes from behind. but gave me other problems like the anchors would come in later or sooner then the actual nav background.

Here is the code.

let Btn = document.querySelector(".menuBtn"); let menu = document.querySelector("nav"); let icon = document.querySelector(".fa-bars"); Btn.onclick = () => {     menu.classList.toggle("show");     icon.classList.toggle("fa-times"); } 
* {     margin: 0;     padding: 0; } body {     background: #F5F5F5;     color: #1F1F1F;     font-family: 'Open Sans', sans-serif;     font-size: 20px; } a {     text-decoration: none;     color: #1F1F1F; } /* --- HEADER --- */ header {     width: 100%;     height: auto;     background: #FFF; } .headerContainer, .container {     width: 90%;     max-width: 1140px;     margin: auto;     padding: 15px; } .headerContainer {     display: flex;     justify-content: space-between;     align-items: center;     position: relative; } /* --- Logo --- */ .headerBrand a {     font-size: 2rem;     font-weight: 800;     display: flex;     align-items: center; } .headerBrand img {     padding: 0 15px 0 0; } /* --- NAV --- */ header nav {     z-index: -1;     /* display: none; */     padding: 15px;     width: calc(100% - 30px);     position: absolute;     top: -100px;     left: -1px;     background: #ffffff;     transition: top 2s; } header nav.show {     top: 100%; } header nav ul.mainMenu {     list-style: none; } header nav ul li a:hover {     color: red; } .menuBtn {     width: 35px;     height: 35px;     text-align: center;     background: red;     font-size: 25px;     border-radius: 5px;     cursor: pointer;     color: #FFF; } /* --- MAIN --- */ main {     position: relative;     z-index: -2; } 
<link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Open+Sans&family=Poppins&display=swap" rel="stylesheet"> <script src="https://kit.fontawesome.com/a9b20b17fc.js" crossorigin="anonymous"></script>  <!-- header-->         <header>             <div class="headerContainer">                 <!-- Logo or Brandname -->                 <div class="headerBrand">                     <a href=""><img src="https://krijgeronline.nl/assets/img/logo.png" width="auto" height="80px"> Logo text</a>                 </div>                 <!-- END Logo -->                 <!-- Nav -->                 <nav>                     <ul class="mainMenu">                         <li><a href="#">First link</a></li>                         <li><a href="#">Second link</a></li>                         <li><a href="#">Thirth link</a></li>                         <li><a href="#">Fourth link</a></li>                     </ul>                 </nav>                 <div class="menuBtn"><i class="fas fa-bars"></i></div>                 <!-- END Nav -->             </div>         </header>         <!-- END header-->         <!-- Main -->         <main class="container">             <section>                 <h1>This is a header</h1>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>                 <p>This is some text</p>             </section>         </main>         <!-- END Main--> 

Border of multiple details tags in one html row are not working responsive [closed]

I have a proble on my website: https://www.ars-neurochirurgica.com/ . I have several accordion menus which I made with pure css without any javascript and everything works perfect, except for one problem:

When I click on the categories to expand the tag, all other boxes which are collapsed with the detail tag which are on the same row will expand their border from the .div. Is there any way to fix this problem without using javascript? I tried to only draw the border if the details tag is open, however then I run into the problem that the border is smaller than the .div because it will be only assigned to the details tag. The best way would be to be able to select the parent element from the details[open] tag. However after doing some research that is not possible with css3 only. Anyone has ideas how to fix this problem? On mobile it works perfectly fine because only one row is displayed….

Here is an image of the problem: CSS Problem

How to Show Specific tags which start checklist- in product page in woocommerce wordpress

I want to show these tags in products page which start with the checklist- (in WordPress woo-commerce)

Kindly provide mw the code, I will replace with this code

get_id(), ‘, ‘, ” . _n( ‘Tag:’, ‘Tags:’, count( $ product->get_tag_ids() ), ‘woocommerce’ ) . ‘ ‘, ” ); ?>

Alternative CSS tags to “display:none;” for SEO [duplicate]

I have always made my pages "by hand". just coding them, a bit of javascript here and there.

And because I like to experiment with designs, i use a lot of popup divs, which means i use "display:none" tags for those divs.

I’ve been told that this could be hurting my searchability. The pages have been online for a long time. does anyone have some advice on this?

Someone has been mentioned that I will have difficulty with SEO and that I need to use a CMS like wordpress.

what do you think my next move should be?

Is there something in my CSS I can change, or do I go the CMS route?

thanks!