1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Post meta: align item

Discussion in 'HTML & Website Design' started by acquawater, Feb 18, 2018.

  1. #1
    Please have a look
    http://backdoorpodcast.com/dnpcd-podcast-le-rubriche-e-il-basket-raccontato-col-sorriso/

    the code is basically showing the POST VIEW (XX LETTURE) before the post's image.
    What I need is to display it beside the 0 comment element, so that it is on the same line and possible with the same font and font size as the rest.

    My code for that line is:
    SEMrush
    /***** Post Meta *****/
    
    if (!function_exists('mh_magazine_lite_post_meta')) {
        function mh_magazine_lite_post_meta() {
            echo '<p class="mh-meta entry-meta">' . "\n";
                echo '<span class="entry-meta-date updated"><i class="fa fa-clock-o"></i><a href="' . esc_url(get_month_link(get_the_time('Y'), get_the_time('m'))) . '">' . get_the_date() . '</a></span>' . "\n";
                echo '<span class="entry-meta-author author vcard"><i class="fa fa-user"></i><a class="fn" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>' . "\n";
                echo '<span class="entry-meta-categories"><i class="fa fa-folder-open-o"></i>' . get_the_category_list(', ', '') . '</span>' . "\n";
                echo '<span class="entry-meta-comments"><i class="fa fa-comment-o"></i><a class="mh-comment-scroll" href="' . esc_url(get_permalink() . '#mh-comments') . '">' . absint(get_comments_number()) . '</a></span>' . "\n";
                         echo '<span class="entry-meta-comments">'; pvc_post_views( $post_id = 0, $echo = true ); echo '</span>' . "\n";
    
    
    
            echo '</p>' . "\n";
        }
    }
    add_action('mh_post_header', 'mh_magazine_lite_post_meta');
    
    /***** Post Meta (Loop) *****/
    PHP:
    how do I have to change the code?
     
    acquawater, Feb 18, 2018 IP
    SEMrush
  2. sarahk

    sarahk iTamer Staff

    Messages:
    24,131
    Likes Received:
    3,252
    Best Answers:
    92
    Trophy Points:
    615
    #2
    The "letture" code comes from another function. You could edit your post_meta to include it and then you wouldn't call the function that is putting it in.
     
    sarahk, Feb 19, 2018 IP
  3. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    hey thank you for your message!
    Would you help me achieve that?
     
    acquawater, Feb 19, 2018 IP
  4. Blizzardofozz

    Blizzardofozz Well-Known Member

    Messages:
    132
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    118
    #4
    Find the letture function, get the result in a variable without echo-ing, echo the letture variable you created in the mh_magazine_lite_post_meta function.

    A different approach would be to put the div with letture on the row of the mh meta. You could do it with absolute positioning or floatings. You have to add some custom CSS rules for the color of the text: #979797 and also for the text size.
     
    Blizzardofozz, Feb 19, 2018 IP
  5. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Hi, and thank you
    Based on the info of the first post, what code should I use?
     
    acquawater, Feb 20, 2018 IP
  6. Blizzardofozz

    Blizzardofozz Well-Known Member

    Messages:
    132
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    118
    #6
    In your first post, we cannot see the "letture" function. This is a function that echoes the readings. You have to find it in your code and return a result and save it in a variable and then echo that variable in
    mh_magazine_lite_post_meta function. Probably after echo '<span class="entry-meta-comments">'; pvc_post_views( $post_id = 0, $echo = true ); echo '</span>' . "\n";

    for example:
    function lettureFunction() {
    body of the function ...
    return $probablySomeString;
    }
    $resultFromLettureFunction = lettureFunction();

    Or could be:
    $resultFromLettureFunction = "";
    function lettureFunction() {
    body of the function ...
    $resultFromLettureFunction = $probablySomeStringThatHasTheOutput;
    }

    Then:
    echo $resultFromLettureFunction in mh_magazine_lite_post_meta function.
     
    Blizzardofozz, Feb 20, 2018 IP
  7. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    thank you for your reply
    Unfortunately my level of competency does not allow me to help you more
     
    acquawater, Feb 20, 2018 IP
  8. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #8
    any help?
     
    acquawater, Feb 22, 2018 IP
  9. Blizzardofozz

    Blizzardofozz Well-Known Member

    Messages:
    132
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    118
    #9
    Is this a joke? You got help! You need to learn or to get a programmer.
     
    Blizzardofozz, Feb 22, 2018 IP
    kk5st likes this.
  10. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #10
    sorry but with the info received it is hard for me to place the code in my template
     
    acquawater, Feb 22, 2018 IP
  11. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #11
    So I am using this code:

    echo '<p class="mh-meta entry-meta">' . "\n";
        echo '<span class="entry-meta-date updated"><i class="fa fa-clock-o"></i><a href="' . esc_url(get_month_link(get_the_time('Y'), get_the_time('m'))) . '">' . get_the_date() . '</a></span>' . "\n";
        echo '<span class="entry-meta-author vcard"><i class="fa fa-user"></i><a href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>' . "\n";
        echo '<span class="entry-meta-categories"><i class="fa fa-folder-open-o"></i>' . get_the_category_list(', ', '') . '</span>' . "\n";
        echo '<span class="entry-meta-comments"><i class="fa fa-comment-o"></i><a href="' . esc_url(get_permalink() . '#mh-comments') . '">' . get_comments_number() . '</a></span>' . "\n";
        pvc_post_views();
    echo '</p>' . "\n";
    Code (markup):
    Below is the image that shows how the function is displayed and how it should.
    Please refer to live link: http://backdoorpodcast.com/dnpcd-podcast-le-rubriche-e-il-basket-raccontato-col-sorriso/

    upload_2018-2-23_21-49-59.png
     
    acquawater, Feb 23, 2018 IP
  12. Blizzardofozz

    Blizzardofozz Well-Known Member

    Messages:
    132
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    118
    #12
    I bet everybody understood the case except you! No need to repeat the question. We cannot see the function that produces the string for Letture so no one can tell you how to modify it.
     
    Blizzardofozz, Feb 24, 2018 IP
  13. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #13
    And I totally understand. The function is there and it's working
    The problem is not displaying in the section I need it.
    Can you please help me more?
     
    acquawater, Feb 24, 2018 IP
  14. kk5st

    kk5st Prominent Member

    Messages:
    3,410
    Likes Received:
    349
    Best Answers:
    26
    Trophy Points:
    335
    #14
    
    .entry-meta {
      border-bottom: 1px dotted #ebebeb;
      border-top: 1px dotted #ebebeb;
      margin-top: 0.625rem;
      padding: 5px 10px;
      text-align: right;
    }
    Code (markup):
    Add the text-align property to the 'entry-meta' class.

    Take care. I don't know if that breaks something else. Test thoroughly.

    gary
     
    kk5st, Feb 24, 2018 IP
  15. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #15
    thank you for your suggestion, this is simply aligning everything on the right.
    What I need is to have "post view" on the same line as comment
     
    acquawater, Feb 24, 2018 IP
  16. sarahk

    sarahk iTamer Staff

    Messages:
    24,131
    Likes Received:
    3,252
    Best Answers:
    92
    Trophy Points:
    615
    #16
    You need to edit the theme. You've been given tons of advice. What's holding you back?
     
    sarahk, Feb 24, 2018 IP
  17. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #17
    and I have, please see comment 15
     
    acquawater, Feb 24, 2018 IP
  18. sarahk

    sarahk iTamer Staff

    Messages:
    24,131
    Likes Received:
    3,252
    Best Answers:
    92
    Trophy Points:
    615
    #18
    or even post #2
     
    sarahk, Feb 25, 2018 IP
  19. acquawater

    acquawater Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #19
    well I can't move forward from this.
    If there is anyway who can tell me how to edit css or any other file I would appreciate.
    Kinda new in the coding part and don't want to mess my site, that's why I thought digital point could be a good place where to post my problem and learn.
    Thanks
     
    acquawater, Feb 25, 2018 IP
  20. sarahk

    sarahk iTamer Staff

    Messages:
    24,131
    Likes Received:
    3,252
    Best Answers:
    92
    Trophy Points:
    615
    #20
    WordPress themes can be very complicated, especially when they have admin panels that let you control a lot of the look and feel. We won't be able to tell you which files to edit unless we've spent a reasonable amount of time digging about in your theme.

    What I'd do
    • use Windows Explorer to find any files that have the word "letture" in it. When you've got the function you can put a wee asterisk* in it and upload. If you can see the asterisk, you know you have the right file.
    • Copy the function and make a new version, say letture2 and remove the outside divs and spans so you just have the mini chart, the words and count.
    • Comment out anything that calls the original version of the function
    • Add your new function to mh_magazine_lite_post_meta
    • test
     
    sarahk, Feb 25, 2018 IP