• Resolved andymiller

    (@andymiller)


    Hi

    Thanks for a really useful plugin. Unfortunately, I’m having some problems with ACF fields.

    I am using ACF and the Insert PHP plugins to create next/previous links for series of articles.

    The code I’m using is:

    <div class="next-previous-links">[insert_php]
    if(get_field('previous'))
    { echo '<a class="previous-link" title="go to the previous page in this series" href="' . get_field('previous') . '"/><i style="position:relative;top:1px;" class="icon-arrow-left"></i>?Previous</a>'; }
    if(get_field('next'))
    { echo '<a class="next-link" title="go to the next page in this series" href="' . get_field('next') . '"/>Next<i style="position:relative;top:1px;" class="icon-uniE637"></i></a>'; } 
    [/insert_php]</div>

    The ‘Previous’ link is aligned to the left and the Next to the right with a border top and bottom. When wp-typography is active the underlying html still seems correct – here’s some sample output:

    <div class="next-previous-links"><a class="next-link" title="go to the next page in this series" href="{correct url from the ACF next field}/"></a>Next<i style="position:relative;top:1px;" class="icon-uniE637"></i></div>

    But the links are no longer styled as links, and aren’t clickable, and nothing happens on hover. Also while the styles in the ‘next-previous-links’ class work OK, the styles in the ‘next-link’ class only partially work:

    The CSS is:

    .next-link {
    	float:right;
    	text-transform:uppercase;
    }

    The text-transform works, but the float doesn’t.

    I’ve tried using the wp-Typography Disable ACF integration but that doesn’t help.

    I can see that someone else has asked about manually disabling wp_Typography on some ACF fields but I don’t know whether this would apply in my case or what I need to do. Any help you can give would be really appreciated.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author pepe

    (@pputzer)

    Have you got a sample page I can look at? And a snippet what the “links” should look like? I take it that the [insert_php] shortcode is not working correctly?

    As for the workflow, have you tried clearing all caches (browser, wp-Typograhpy’s, any page caching plugin you are using) after installing wp-Typography Disable ACF Integration? With that plugin, wp-Typography should not do anything to ACF fields (unless you apply the the_content filter to them somehow).

    Thread Starter andymiller

    (@andymiller)

    Hi Pepe

    Wow, thanks for getting back to me so quickly.

    Here’s a link:

    https://italy-cycling-guide.info/cycleways-cycle-routes/lakes-and-mountains/western-lakes

    wp-Typography is currently deactivated. I can activate it again if you need me to.

    I’ve just been trying clearing the caches after activating wp-Typography and Disable ACF integration. (I’m using W3TC and I cleared the page cache for that specific page rather than for all pages). I tried using Chrome (and deleting the browsing data) instead of Safari, but the results were the same.

    Plugin Author pepe

    (@pputzer)

    @andymiller: Yes, please activate the plugin.

    Thread Starter andymiller

    (@andymiller)

    Done. I’ve activated disable ACF integration as well, cleared the WPT cache, and the W3TC cache for all pages.

    Plugin Author pepe

    (@pputzer)

    @andymiller: The problem is with your HTML in the [insert_php] shortcode:

    { echo '<a class="next-link" title="go to the next page in this series" href="' . get_field('next') . '"/>Next<i style="position:relative;top:1px;" class="icon-uniE637"></i></a>'; }

    The <a> tag is written as <a />, which would mean it’s a self-closing tag. Consequently, the HTML parser in wp-Typography closes the tag at that point and removed the now dangling </a> after “Next”.

    Thread Starter andymiller

    (@andymiller)

    Wow Thank you. I’ll fix that now.

    Thread Starter andymiller

    (@andymiller)

    Yep that’s fixed the problem – thank you *so* much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problems with ACF’ is closed to new replies.