-
omp-generatepress
Hi,
I need help with a ACF field and a Generate Press Hook.
I want to add a <h2> Sub-Headline to all my Tag pages. For this I have added a ACF field “h2_tag_pages” with the location rule: Show this field group if > Taxonomy > is equal to > tag
This works perfect, now I have a new field when I edit an Tag page.
Now I want to show this field on tag pages via Elements > Hook.
You can see on the word “Test” that the Hook is displayed on Tag pages, but the code<?php the_field('h2_tag_pages'); ?>
is not shown.What can be the reason for this? I also use ACF fields for other hook elements on posts and it works without any problems. Is there a problem with tag pages?
————
And I found another strange behavior in the hook element. In the Display Rules of the Hook Element I use the setting: Location > Post Tag Archive > All Tags
As soon as I click on “Update ” this setting is automatically changed to: Location > Media Tag Archive > All Tags
Why is this being changed?
-
Alvind
Hi there,
The display rules location changing is odd behavior. The H2 tag isn’t showing up, perhaps because of that reason.
Would it be possible for you to provide a temporary admin login so we can take a closer look?
-
omp-generatepress
At the moment I develop on localhost, so I can´t give you a temproray admin login.
The H2 tag isn’t showing up, perhaps because of that reason.
I don´t think that this is the reason. The other content from the Hook is displayed. I think the ACF field is not active on Tag pages?
-
Are you using SCF plugin or ACF plugin?
-
omp-generatepress
It´s ACF – Version 6.3.11
You can see it in the wordpress menue on the screenshots above.
-
I see, not sure why it’s not working.
Does the ACF shortcode work in this case?
-
omp-generatepress
Does the ACF shortcode work in this case?Does the ACF shortcode work in this case?
I have also tried the shotcode, but it doesn´t work.
Can you take a look at this please?
https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/Is this something we have to add to the GeneratePress child function.php?
-
No, you should not need to modify the category.php.
Try this instead:
<h2><?php the_field('h2_tag_pages',get_queried_object()); ?></h2>
-
omp-generatepress
Sometimes the solution can be so simple 😉 Thank you, it works.
And were you able to reproduce the other problem with the changing of the display rules location?
-
And were you able to reproduce the other problem with the changing of the display rules location?
what is the other problem?
-
omp-generatepress
Please see my first post above after the “——————”
And I found another strange behavior in the hook element….
-
Hum…I’m not sure, if you can upload the site online we can take a look at the backend.
-
omp-generatepress
Have you tried to reproduce the issue on your site?
-
Alvind
There should no Media Tag Archive option in the Display Rules list by default, so it’s unclear why that is present in your Element configuration.
If you can make your site live, we can assist further with debugging this issue.
- You must be logged in to reply to this topic.