• Resolved betic1

    (@betic1)


    I’m trying to implement a bit of code displaying social icons at the end of my posts and also on my index page, but am confused by the results. I used an if (is_* () or is_* ()) statement and it’s giving me 2 sets of results. I pasted the code below. Without the OR statement, it simply posts the social icons once on whatever page I specify, with the AND statement, it’s displaying one set of social icons and below that another set on both the front page and the single pages.

    I tried an elseif statement, but I’m unable to get that to work for some reason. The global $post and the following ?> for that seem to be breaking it. So, I’m up for any ideas as it’s probably something simple I’m missing.

    Here’s the link to the code:

    https://pastebin.com/wuwa7r0g

Viewing 1 replies (of 1 total)
  • Thread Starter betic1

    (@betic1)

    Never mind. This wasn’t making sense because I had the shortcode to call this function in 2 separate files: the actual single.php and the content.php which is why it showed up twice.

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with functions.php IF statement or conditional statements’ is closed to new replies.