Exactly, I gotta head out and will check back later this eve or tomorrow morning. If you got it sorted let me know.
It does seem like a long way around but since the modal is created by JavaScript, we’ll most likely have to use JavaScript to influence to the modal.
The <a>
tag is our link between the HTML and the corresponding JavaScript modal.
In your page template file
Check if the video has Signed set to TRUE, if so add a class (let say “issigned”) to it’s <a>
tag.
<a href="your-url"
<?php if( get_field('signed') ): ?>
<?php echo 'class="issigned"'; ?>
<?php endif; ?>
>
In your Javascript file
When an <a>
with class issigned is clicked, add another class to the modal.
As I mentioned, I’m no expert developer and there might be a better solution to this.
So it looks like the theme is the issue.
Clone the production website to a local server, try it out, if it still fails, use a different theme and see if the issue persists.
Is the fresh installation running on the same server as the production one? It might also be the production server that prevents WordPress from storing IP’s, although this is unlikely.
What if you add a class to the thumbnail’s <a>
tag (that initiates the modal) which has the Freelance value as true.
Use JavaScript to check if an <a>
tag with your class is clicked, if so, add another class to the modal which you can then reference to show the hidden <h3>
.
I’ve tested this on a clean WordPress install without any issues.
Can it be that another plugin is causing this? Try and disable all plugins except ACF and see if that resolves the issue.
Otherwise, see if you can setup a clean WordPress install with only ACF and your custom fields as well as your custom post type.
Would it be possible to view the webpage?
So are you having difficult adding the class because the modal gets generated by JavaScript?
Hi Andrea,
Which ACF field type do you use to add the URL?
Hi Nick,
I’m no php expert so there might be a better solution than this, but maybe you should rather use the True / False field type.
Add the if statement to your modal:
<div <?php if( get_field('vid_freelance') ): ?>>
<?php echo 'class="lity-info"'; ?>
<?php endif; ?>Modal content</div>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.