'ACF field in function.php

Following the request of an SEO agency, I'm trying to recover the content of a field (that I created via ACF in the product categories of WooCommerce) in a function of the functions.php file. I've tried a few tricks found on the net, but nothing works, I can't recover the content.

It's to replace the product category title by another one (the one of the new ACF field) and that this title is only displayed on the category archives of the site (not in the menus and other widgets where the default title is displayed.

Here is the code I did. I get the ID back fine if I display it, I make progress but nothing for $value

<?php
$query_id = get_queried_object_id();
function titre_seo_cat_prod() {
// recupere la valuur d'un post specifique
$value = get_field( 'titre_seo_categorie_de_produit', $query_id );
return $value;
}
?>


Solution 1:[1]

You can enable the sliding expiration to prolong the application session as long as the user is active. Then the ITfoxtec Identity SAML 2.0 component has access to the session information and can do logout.

services.AddSaml2(slidingExpiration: true);

Link to sample where the slidingExpiration is enabled. https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestWebAppCore/Startup.cs#L58

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anders Revsgaard