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: /***** 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?
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.
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.
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.
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/
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.
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?
.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
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
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
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