posts – Automatically fills the custom taxonomy with a value from a custom field

I am working on a real estate website and at the moment we have a feed that automatically imports new regional listings (RETS flows). Some fields of the publication type & # 39; properties & # 39; provided with the real estate plug-in that I use are automatically populated with the import. The most important of these areas is "City".

We are working on an automatic notification system via Mailchimp, in which users can register to receive new list notifications. For now, the RSS feed will pull ALL new properties. I want users to have the ability to select the cities they want to see the properties of, rather than receive all the regional lists. BUT city information fits into a custom field rather than a custom taxonomy.

What I would like to do is find a way to make the value of the city field automatically complete a custom taxonomy for the city, so that I can extract these more specific RSS feeds in lists Mailchimp segmented according to the selections of the user.

Someone recommended doing it via save_post, but I'm more of a designer than a developer – so that goes beyond my limited abilities in PHP.

So, to recap, what I want is that a new message 'properties & # 39; either imported with the custom field & # 39; city & # 39; filled in – then automatically populate a custom taxonomy for city with the same value – pushing it into this specific RSS Feed field for the taxonomic value of that city.

Have a sense? Enjoy all the recommendations anyone could have here for a novice in PHP. Thank you.

7 – Is it possible to obtain Solr index taxonomy term fields?

I have a taxonomy and each term has fields like body etc. and can be viewed as a page as content. These terms are parents with node groups each.

I can easily ask Solr to index the nodes via the content type, but I have trouble understanding how to get the indexed term fields as well.

Can anyone suggest how we could do it?

Query a custom taxonomy in a function to create a csv file

I have trouble getting the custom taxonomy query to work in this function. The filter $ is full of data but the get_posts () does not use it? The query works without tax_query and there are: custom publications with the correct taxonomy (list) … do I want to miss it?

add_action (& # 39; restrict_manage_posts & # 39 ;, & quot; add_export_button & # 39;);
function add_export_button () {
$ screen = get_current_screen ();

if (isset ($ screen-> parent_file) && (& # 39; edit.php? post_type = certificate & # 39; == $ screen-> parent_file)) {
?>
        
        
            & # 39; & # 39 ;, certificate
& # 39; post_status & # 39; => & Quot; publish & quot;
& # 39; posts_per_page & # 39; => -1,
& # 39; tax_query & # 39; => table (
board (
& # 39; taxonomy & # 39; => & # 39; list & # 39 ;,
& # 39; field & # 39; => & # 39; slug & # 39;
& # 39; terms & # 39; => $ filter,
)
)
)

global $ post;
$ arr_post = get_posts ($ arg);

if ($ arr_post) {

header (& # 39; Content-type: text / csv & # 39;)
header ('Content-Layout: attachment; filename =' wp.csv '');
header (& # 39; Pragma: no-cache & # 39;);
header ('Expires: 0');

$ file = fopen ('php: // output', & # 39; w & # 39;);

fputcsv ($ file, array ('Article title', 'URL'));

foreach ($ arr_post as $ post) {
setup_postdata ($ post);
fputcsv ($ file, array (get_the_title (), get_the_permalink ()));
}

exit();
}
}
}

Thematization – How to use 2 different taxonomy view modes on a node page?

On a node page, I have a term reference field. This term contains 3 fields

For the term, I created some display modes:

  1. view_mode_first contains: field_1
  2. view_mode_second contains: field_2, field_3

crochet theme suggestions:

        function theme_theme_suggestions_taxonomy_term_alter (array & $ suggestions, array $ variables) {
$ term = $ variables['elements']['#taxonomy_term'];
array_splice ($ suggestions, 2, 0, & taxonomy_term __ $ term-> bundle (). & # 39; __ # variables['elements']['#view_mode'])
}

node field template, where I display the referenced terms:

        {% for the article in the articles%}
{% set first = item.content | merge ({# view_mode: view_mode_first}%}
{{first}}
{% endfor%}


{% for the article in the articles%}
{% set second = item.content | merge ({# view_mode: # view_mode_second})
{{ second }}
{% endfor%}

But as a result, I get the same models everywhere: taxonomy-term – name – view-mode-first.html.twig and not a taxonomy-term – name – view-mode-second.html.twig

I found that if I disabled rendering cache in a settings.local file, both models work:

$ parameters['cache']['bins']['render']    = & # 39; cache.backend.null & # 39 ;;

Is it possible to disable the rendering cache for a node and / or specific fields?

theming – View Fields twig: How to get taxonomy terms for a field?

Stuck on this one. I use Drupal 8.

I have a view fields hook that lists the content in twig. From these fields, I can recover other fields such as text.

{{}} Fields.field_teaser.content

I am unable to get the taxonomy terms though. I was trying this. I'm trying to find the names of the terms, but everything is in white.

{{}} Fields.field_tags.content

Any help would be appreciated.

taxonomy terms – Help to show and / or hide exposed filters

I now have a constructed view for a particular type of content that we will call a "part". Then there is a vocabulary "Parts" to assign a taxonomy term or terms to sort this content in my menu. Everything works fine, but I'm wondering if I can apply a filter exposed to just one branch of my menu tree.

So, my view governs:

Part of the content that is attributed to:

"Pieces" (vocabulary for the menu)

  • taxonomy term "part of category A"
  • taxonomy term "part of category B"
  • taxonomy term "part of category C"
  • Taxonomy term "part of category D"

Etc …

I wish I could put a filter exposed only on the taxonomy term "part of category B" but not the rest.

Should I / then build a separate view exclusively for taxonomy term "part of category B", then exclude taxonomy term "part of category B"of the existing view?

Or, is there a way to automatically hide the exposed filter when no content has the aspects attributed to this exposed filter? (It seems like a solution that many are looking for?)

I hope that makes sense. I've read some articles about filter masking, but I have not found a solution yet.

Thanks in advance!

custom publication types – View Impress Listing plugin listings in a random order using taxonomy and terms

I can not bring up the lists. I've checked the slug for the post type and taxonomy. I know this code works because I have used it for other types of publications and taxonomies. Any idea of ​​why this would not work here would be appreciated. Thank you.

    & # 39; wp-listings & # 39 ;, // your property post type slug
& # 39; posts_per_page & # 39; => 50,
& # 39; orderby & # 39; => Rand, order by
& # 39; order & # 39; => & # 39; ASC & # 39; // Show previous events first
& # 39; tax_query & # 39; => table (
board (
& # 39; taxonomy & # 39; => & # 39; property-types & # 39;
& # 39; field & # 39; => & # 39; slug & # 39;
& # 39; terms & # 39; => array ($ tag)
))
)

$ query = new WP_Query ($ args);
if ($ query-> have_posts ()):
while ($ query-> have_posts ()): $ query-> the_post (); ?>

<div class = "col-md-4" id = "">
            
<a href = "">