menu for custom type and taxonomy at the same time or filter by type

I have two custom types (eg: Cooks and Restaurants) and both have a shared taxonomy (eg: specialty). I want a menu that pulls all the restaurants based on a specific specialty but there doesn’t appear to be a way to use appearance -> menu to add the specialty taxonomy so that it only links to restaurants but not to cooks. eg: a menu that basically does a search for one type with that taxonomy match but doesn’t also pull the other type with that taxonomy match

To be clear I can get the taxonomy with both by simply editing a menu, placing a check-mark in the taxonomy name in screen options and then adding the individual taxonomy terms… I just don’t see how to filter the results to be only a single type. I assume that I will need to do this with some code but wanted to be sure I wasn’t over-engineering it.

Is there a way that is built into WordPress that would allow this to be done or am I looking at writing some custom code/adding a plugin? Alternately… what keywords should I have used to find an answer to this? It seems like anything that is remotely related is dealing with using a taxonomy with the same name as a type. I also looked at the title (at a minimum) of all the advanced-taxonomy-queries tagged questions when I discovered that but none seemed to be like my issue (though many were interesting in other ways).

Filter records and find those with minimal date

I have the following tables in Microsoft SQL Server:

  1. Users: Includes uID (primary key), birthDate, name
  2. Conversations: Includes convID (primary key), hostID (foreign key for uID in Users)
  3. Participants: Includes uID (foreign key for uID in Users), convID (foreign key for convID in Conversations).

I need to write a query which finds the name, ID and birth date of the oldest user who didn’t participate in any conversation, and that his name contains the letter ‘b’. If there is more than one user, I need to return all of them.

I don’t know how to both filter the users, and than find those with the minimal birth date (the oldest).

how to display count of total posts and for every category and having possibility to filter between dates and user

Hello i use simple plugin that count numbers of posts for every category and total but i was stuck in how to display count of posts between to dates and with authors.

<div class="wrap posts-and-users-stats">      <nav class="nav-tab-wrapper">         <?php echo "<h2> Nombres des articles </h2>" ?>      </nav>      <section>         <?php     $  categories = get_categories( array(     'orderby' => 'name',     'order'   => 'ASC' ) );           <table id="table-<?php echo esc_attr($  taxonomy); ?>" class="wp-list-table widefat">                         <tbody>                 <?php foreach ($  categories as $  category) { ?>                     <tr>                         <td><?php echo esc_html($  category->name ); ?></td>                         <td class="number"><?php echo esc_html($  category->count); ?></td>                     <?php } ?>                     </tr>             </tbody>                  </table>     </section>   </div> 

this the code i used for filter

<form method="post">             From : <input type="date" name="from">             To : <input type="date" name="to">             User :<?php wp_dropdown_users($  args); ?>             Cat├ęgories :<?php wp_dropdown_categories($  args); ?>             <input type="submit" name="submitbtn">         </form>     <?php          $  from = $  _POST['from'];     $  to = $  _POST['to'];     $  user = $  _POST['user'];     $  category = $  _POST['categories'];     print "From" . $  from . "\n";     print "To" . $  to . "\n";     print "User" . $  user . "\n"; 

Need to filter by month

I am trying to filter by month using dtm DATETIME as my format XX/XX/XXXX. i am a very new to SQL, so i was trying to just filter by the month of January 01 with the format

Where Date = ’01/XX/XXXX’

is there a way to search by date like this?

Select

TPolicies.intPolicyID AS 'Policy ID' ,TPolicies.strPolicyNumber AS 'Policy Number' ,TPolicies.dtmDateOfPurchase AS 'Purchase Date' ,TPolicyTypes.strPolicyType AS 'Policy Type' ,TAgents.intAgentID AS 'Agent ID' ,TAgents.strFirstName AS 'Agent First Name' ,TAgents.strLastName AS  'Agent Last Name' 

From TCustomerPolicies Join TCustomers On TCustomerPolicies.intCustomerID = TCustomers.intCustomerID

Join TPolicies ON TCustomerPolicies.intPolicyID = TPolicies.intPolicyID  Join TStates ON TCustomers.intStateID = TStates.intStateID  Join TGenders ON TCustomers.intGenderID = TGenders.intGenderID  Join TRaces1 ON TCustomers.intRaceID = TRaces1.intRaceID  Join TPolicyTypes ON TPolicies.intPolicyTypeID = TPolicyTypes.intPolicyTypeID  Join TAgents On TPolicies.intAgentID = TAgents.intAgentID  WHERE TPolicies.dtmDateOfPurchase =  

thanks

Scott

How do I add a div class to the posts in a filter and not the entire filter element?

I am having some troubles with the Isotope filter gallery, as discussed in my Stackoverflow question here.

As per the first point of the accepted answer, I need to add the class .isotope, to the parent (the .row element) to make it work with URL hashes. Otherwise, it only works when you click on the filter links, as you can try on the live webpage.

Here is the element to which the user told me to add the class:

<div class="isotope row masonry" data-masonry-id="d2546a5a8aed79adf8c0b3b78a16b29f" style="position: relative; height: 969.6px;">

Notice the <div class ="isotope before row masonry bit? That is what I need to add.

However, I can only apply a custom class to the entire Posts element in Elementor. If I do that, it causes the JS to think that it needs to sort the whole grid itself and makes it disappear.

How do I target this specific row element?

Filter custom post types in archive

I want to filter my custom posts (pump) with a custom filter form on it’s archive page (archive-pump.php).

So, I wrote the form markup:

<form method="GET">     <label>Series</label>     <?php         if( $  terms = get_terms( array( 'taxonomy' => 'series', 'orderby' => 'name' ) ) ) :             echo '<select name="series">';             foreach ( $  terms as $  term ) :                 echo '<option value="' . $  term->term_id . '">' . $  term->name . '</option>'; // ID of the category as the value of an option             endforeach;             echo '</select>';         endif;     ?>     <button type="submit">Apply filter</button> </form> 

And I have this to output my custom posts:

<?php if(have_posts()) : while(have_posts()) : the_post(); ?>     <?php the_title( '', '', true ); ?> <?php endwhile; endif; ?> 

When I open my page (localhost/project/pumps) it looks fine. But when I submit my form I’m getting an 404 page.

I maybe need an seperate query to fetch all the $ _GET data. But I’m not getting to the step because of the 404 error.

What am I doing wrong? Thank you!

Google Analytics: View filter not picking up any traffic

I have created a new view (a copy of the main one) and set a filter as follows:

enter image description here

However, if I visit any URL with that inside of it, nothing gets picked up on the real-time view. However it does get picked up on the main view, where there are no filters.

I can’t click on the verify link as it’s saying the service isn’t available

Any ideas?

How do I filter out items on DnDBeyond that have no cost?

I’m trying to filter equipment items on DnDBeyond so that only items whose value is between 1 cp and 1 gp is shown.

The problem is that this is giving me a lot of items that have zero cost. I tried the entering the following values for the minimum cost but none are valid:

  • 1 cp
  • 1 copper
  • .01

I can’t find any sort of key that helps with this. Is there a way to filter out items without a cost and what is it?

How to Filter custom post type by taxonomy?

here is my code trying to make it

  <div class="row"> <div class="col-lg-3 col-md-12"> <div class="card">     <div class="card-body">     <form action="<?php the_permalink() ?>" method="GET">   <?php  $  terms = get_terms([   'taxonomy' => 'topics',   'hide_empty' => false ]);  foreach ($  terms as $  term) :  ?>  <label>      <input       type="checkbox"       name="topics[]"       value="<?php echo $  term->slug; ?>"       <?php checked(         (isset($  _GET['topics']) && in_array($  term->slug, $  _GET['topics']))       ) ?>     />      <?php echo $  term->name; ?>    </label>  <?php endforeach; ?>   <button type="submit">Apply</button>  </form>      </div> </div>     </div><!--end of col1 -->     <div class="col-lg-9 col-md-12"> <div class="row"> <?php $  courses = new WP_Query(     array(         'post_type' => 'courses', // This is the name of your post type - change this as required,         'posts_per_page' => -1,         'tax_query' => array(                             array(                                 'taxonomy' => 'topics',                                 'field'    => 'slug',                                 'terms'    => $  term->slug,                                 'operator' => 'IN'                                 )         ) // This is the amount of posts per page you want to show     ) ); while ( $  courses->have_posts() ) : $  courses->the_post(); // The content you want to loop goes in here: ?> <div class="col-lg-6 col-md-12">                                 <div class="card shadow bounceIn"                                     style="margin-top: 10px; border: none; border-radius: 13px;">                                     <div class="card-header"                                         style="color: white; text-align: start; border-top-left-radius: 13px; border-top-right-radius: 13px; background-color: #EE225D;  border:none;">                                         <h6 style="padding-bottom: 0; margin-bottom: 0;"><?php the_title(); ?></h6>                                     </div>                                     <div class="card-body"                                         style="padding-top: 20px; padding-bottom: 20px; color: #2B2365;">                                         <h6 style="font-weight: 700;"><?php the_field('full_name'); ?></h6>                                         <p><?php echo wp_trim_words( get_the_content(), 30, '...' ); ?></p>                                         <a  href="<?php the_permalink(); ?>"                                             style="float:right; color: #EE225D; background-color: transparent; border-color: #EE225D;">View                                             Course</a>                                     </div>                                 </div>                             </div>  <?php endwhile; rewind_posts(); wp_reset_postdata(); ?>   </div>     </div><!--end of col2 --> </div> 

but when i refresh the page it keeps trying to load and when i remove function rewind_posts it load the page but filters not working i watched many videos trying to solve it but no success code explanation two columns one having the filters and second column having the posts