[Resolved] Issues with hook

Home Forums Support [Resolved] Issues with hook

Home Forums Support Issues with hook

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1141856
    David

    Hello!

    Issue 1: We have a “scientifically reviewed by xxx” added here: https://socialpronow.com/blog/how-to-bond/

    It was added as through a hook. (after_entry_title)

    However, we also want it to show up under the author name for the same articles in archives: https://socialpronow.com/blog/

    Issue 2: If you make a mobile preview of the scientifically reviewed text, you see that it’s smaller than the author text above it: https://socialpronow.com/blog/how-to-bond/

    When looking at the author text in chrome inspector it says font-size 85%, so that’s what I set the scientifically reviewed to, but it still behaves differently. How can we make it the same?

    Issue 3: How do I change the link color on author to match the one of scientifically reviewed by?

    #1141988
    Leo
    Staff
    Customer Support

    Hi there,

    1. Did you include Blog and All Archives under the display rules of the element?

    2. On mobile it actually inherits the body text setting so try this:

    @media (max-width: 768px) {
        .factchecked {
            font-size: inherit;
        }
    }

    3. Try Customizer > Colors > Content > Entry meta Links Hover.

    Let me know if this helps ๐Ÿ™‚

    #1142700
    David

    Hello, 2,3 solved – thank you!

    For 1, when adding blog + all archives to the display rule, the “scientifically reviewed by” shows on all blog posts on archive. We only want them to show for those posts that have actually been reviewed. Ie, the blog posts that have been tagged with “reviewed by”.

    #1142711
    David
    Staff
    Customer Support

    Hi there,

    For your All Archives and Blog Hook you can add a condition around your HTML like so:

    <?php if ( has_tag( 'tag_slug' ) ) { ?>
        // Display your HTML 
    <?php } ?>

    just change the tag_slug to match the requirement.

    #1142935
    David

    Hi, David

    I tried adding the following as a hook and set display rules to blog and all archives.

    <?php if ( has_tag( 'fact-checked-by-viktor-sander-b-sc-b-a' ) ) { ?>
    <p class="factchecked">Scientifically reviewed by <a href="https://socialpronow.com/about-viktor-sander/">Viktor Sander B.Sc., B.A.</a></p>
    <?php } ?>

    However, it still shows the hook for articles without that tag.

    #1143144
    Tom
    Lead Developer
    Lead Developer

    Can you link us to a post with that tag?

    Let me know ๐Ÿ™‚

    #1145875
    David

    Hello! This one for example: https://socialpronow.com/blog/how-to-bond/

    #1145889
    David
    Staff
    Customer Support

    That post has a tag of:

    reviewed-by-viktor-sander-b-sc-b-a

    #1146249
    David

    I’m sorry about that. I’ve corrected it, but the problem persists.

    Attempt 1: Combining in one hook: https://paste.pics/f3bb92721dbe8c1f6f6cbc8aa9c6e556
    Attempt 2: Separate hook: https://paste.pics/0e085a346e056d34e53b439b982c7889

    Both make the “reviewed by” show up on all blog entries in the archive and /blog

    #1146373
    Tom
    Lead Developer
    Lead Developer

    You shouldn’t need any of the PHP inside the hook if you’re using the Display Rules to target the tag. Can you try without?

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.