Categories
CMS Mastering Development Wordpress

WP_Query inside foreach loop returning same value for all options when filtered using ajax

I am trying to build a timetable to display classes by time. I have a taxonomy of Day, which I am looping over to create a column for each day of the week. In side the column is a WP_Query which filters using the day taxonomy and meta_key classes_entry_start_time to orderby meta_value_num. The timetable is […]

Categories
CMS Mastering Development Wordpress

Multiple taxonomy And acf filter group by

I have a widget that must display my custom post type. I don’t display title or content, but just the values of 3 custom fields (acf) : start date, end date and city. Here is my loop. I grab all the custom post that have the selected taxonomies (category and level). It’s working. $args = […]

Categories
CMS Mastering Development Wordpress

Multiple taxonomy And acf filter group by

I have a widget that must display my custom post type. I don’t display title or content, but just the values of 3 custom fields (acf) : start date, end date and city. Here is my loop. I grab all the custom post that have the selected taxonomies (category and level). It’s working. $args = […]

Categories
Mastering Development

Unable to display the data by using useEffect hook inside MaterialTable

import React,{useEffect, useState} from ‘react’; import MaterialTable from ‘material-table’; import axios from ‘axios’; // function for adding the export default function MaterialTableDemo() { const [state, setState] = React.useState({ columns: [ { title: ‘Id’, field: ‘Id’ }, { title: ‘Todo’, field: ‘Todo’ }, { title: ‘Description’, field: ‘Description’, type: ‘numeric’ }, ], data: [], }); // […]

Categories
CMS Development Wordpress

AJAX Post Filter

On my website i made ajax taxonomy filter which is working fine with dropdown select, but i need buttons instead of dropdown. When i am editing code to buttons, filter isnt working, it shows mainc category posts. Please anyone help me Heres my code <form action=”<?php echo site_url() ?>/wp-admin/admin-ajax.php” method=”POST” id=”filter”> <?php if( $terms = […]

Categories
CMS Development Wordpress

tax_query and sort by meta_key – no results

I have query: $tax_query = array( ‘relation’ => ‘AND’); $tax_query[] = array( ‘taxonomy’ => ‘kategoria’, ‘field’ => ‘id’, ‘terms’ => $term->term_id, ); if($_GET[‘kolor’]) { $tax_query[] = array(‘taxonomy’ => ‘kolor’, ‘field’ => ‘slug’, ‘terms’ => $_GET[‘kolor’]); } $query = new WP_Query( array( ‘post_type’ => ‘produkt’, ‘posts_per_page’ => 1000, ‘tax_query’ => $tax_query, ) ); And this works […]

Categories
CMS Development Wordpress

Modifying category order

I am working with a directory style wordpress theme that displays categories in masonry style columns with their posts listed under each category title. The categories are appearing on the front page in alphabetical order and I would like to change this preferably using advanced custom fields. I have managed to control the post order […]

Categories
CMS Development Wordpress

Display queried posts in a custom post type & taxonomy loop template

I have two custom post types (‘services’ and ‘case_studies’) which one of them (services) is a taxonomy to the other (case_studies). My goal is to display a list at the bottom of ‘single-services.php’ to display/get all the posts (case_studies) that ‘this service’ was tagged. This is what I got so far: <ul class=”projects-worked-list”> <?php if […]

Categories
CMS Development Wordpress

how do you pull data from two taxonomies?

I have posts loaded from taxonomy, but I’m trying to get the data of another, that’s also attached to the same post. In the code below, the main focus is getting $location_slug. Knowing how to get that I think I’d know how to get more data out of the second taxonomy. // args for the […]

Categories
CMS Development Wordpress

Sort by an ACF field in a tax_query

I do not find the solution which must surely be surely simple. (I’m new to WP) I have an ACF field named “partners_order”. I would like to sort it in ascending order (ASC) here’s what i tried <?php $terms = get_terms(‘type_partenaires’); usort($terms, function($a, $b) { return get_field(‘ordre_affichage’, $a) – get_field(‘ordre_affichage’, $b); }); foreach ( $terms […]