• Nice modification. Everyone knows there’s always too much to read on most websites so Icons and Font Awesome make a for a better UX

  • it doesn’t work for me…

    • What isn’t working? If you need help, feel free to post your issue in the forum. Thanks

  • In template-tags.php, line 86 and 91 both begin with “esc_html_x”. To get them to function, need to make them simply begin “_x”. Believe this may be a later change to underscores after video was shot?

    • Yeah, probably just a change to underscores since you are using a different version. For anyone interested you can read about the functions here: https://codex.wordpress.org/Function_Reference/esc_html_x and here: https://codex.wordpress.org/Function_Reference/_x

      • Is there any risk to not using escaped html here, btw?

        • Not a major risk, but it is always a good idea to sanitize and escape incoming data and content that is presented to the end user. Especially when you are allowing people you don’t know add data to your site.

          • ok — then, when I tried to do the same code with esc_html_x, it didn’t work. any ideas why that might be?

          • They are two different functions. Did you read about them at the links I provided a couple comments above?

  • Leon Gotje

    I had to add the following CSS rule in order to get the byline field back on my homepage.

    .entry-meta .byline{
    display: inline;
    }

  • Jatin Johny

    Hi Brad!!!
    I’m facing a some kind of bug.
    On my index page user icon and name does not appear
    But on single page it appears.
    Please review the snapshots

    • Jatin Johny

      @leongotje:disqus Method worked to resolve this.

      • Jatin, glad you got it sorted out. Moving forward please ask your support questions in the forum

  • Antony

    Any reason not to just edit the Echo’d line?

    This would work in the new underscores theme…etc …?

  • Marco B

    I could not figure out a fix to add the icon in the esc_html_x . It seems from what I read both should work . I had to add the clock before the esc and concatenate. I am sure this is not ideal but it was the only thing that worked.

    • Did you look over the below comment with the same question?

  • Here’s my solution for the esc_html_x() problem. I removed the “Posted on” text from the $posted_on variable. Then I added the icon to the echo statement. This way I can leave esc_html_x() intact:

    $posted_on = sprintf(
    esc_html_x( ‘ %s’, ‘post date’, ‘shinebox’ ),
    ‘ . $time_string . ‘
    );

    echo ‘‘ . $posted_on . ‘ ‘ . $byline . ”; // WPCS: XSS OK.

  • Here’s my solution for the esc_html_x() problem. I removed the “Posted on” text from the $posted_on variable. Then I added the icon to the echo statement. This way I can leave esc_html_x() intact:

    • Actually, it’s better to put the tags inside the tag. I did this for the byline as well.

      • Thanks for posting your solution. There is a topic on this in the forum as well.

    • Nevermind. I couldn’t find a way to do all the font awesome icons this way. So instead, I put them in the css like this:

      .posted-on a::before, .byline a::before, .cat-links a::before, .comments-link a::before {
      font-family: fontawesome;
      font-size: 14px;
      padding-right: 5px;
      }

      .posted-on a::before {
      content: “f073”;
      }

      .byline a::before {
      content: “f007”;
      }

      .cat-links a::before {
      content: “f07b”;
      }

      .comments-link a::before {
      content: “f075”;
      }

      • I am not sure why you are doing it this way. If you are having issues or need help moving forward, please use the forum instead of the comments section.

        • I put it here because I’m just following up on something I posted here earlier. So if anyone runs across my comment, they see that I changed my mind. When I get a chance I can post it in the forum.