get the tags wordpress PHP (3 posts)

  1. bondigor69
    Posted 3 years ago #

    hello guys I have this code from wordpress CODEX

    $posttags = get_the_tags();
    if ($posttags) {
      foreach($posttags as $tag) {
        echo $tag->name . ' #';

    And I split the tags with #

    And there is the tags (wordpress #codex #howto #blabla #)
    The dash separates the tags!!!
    How can I put the # before each Tag instead separating the tags with the dash

  2. Michael
    Part-Time Forum Moderator
    Posted 3 years ago #


    echo '#' . $tag->name . ' ';
  3. bondigor69
    Posted 3 years ago #

    greattttttt thank you
    can you also help me with that

    <strong>Online Price</strong>:$ 20.00<br>
    <span style="color: red;">Your Price</span>:$ 17.91<br>

    I want to get the second price (17.91) without dollar sign and space and ECHO it somewhere else.
    Can someone help me please
    PS every post have the same HTML above only price changing

Topic Closed

This topic has been closed to new replies.

About this Topic