[Theme: Prana]: Entry meta separators in posts… again
-
Hi guys,
With regards to my yesterday’s post, and my page at http://www.dynamitri.pl – I am, regrettably, still struggling with the entry meta separators “
\
” on my website.As you can see, the top part of the post where the date and my nickname etc. is, has got those “
\
” marks separating the meta data. Unfortunately, for some reason, I cannot get it to work between the functionsprana_post_date
andprana_post_category
. Only this instance and this very combination causes problems, as evidenced by the only post on the website. I have attempted to replaceprana_post_category
withprana_post_author
, and the separator magically shows up. However, the code seems not to generate the meta entry separator betweenprana_post_date
andprana_post_category
for the reasons unknown to me.The code, located in my content.php file, which is responsible for that part of the post, looks as following:
<div class="entry-meta"> <?php echo prana_post_date() . prana_post_category() . prana_post_author() . prana_post_sticky() . prana_post_edit_link(); ?>
I have copy/pasted the full contents of the utility.php file from the original Prana Theme I keep unpacked in an offline folder on my computer – I’ve done this to rule out any accidental changes I might have done to the file along the way, and to restore its original state. Alas, no change whatsoever. The date and categories still appear to be glued together without any separator inbetween – even though, to the best of my knowledge, the code quoted above is correct – after all, the separator between
prana_post_category()
andprana_post_author()
works perfect! And the way these two are separated looks the same to me as the way thatdate
andcategory
are separated…Does anyone have any ideas as to what might be going on here, and how to resolve the situation? I’m struggling to get this separator between
date
andcategory
, just as it shows up for the rest of the metadata?Many thanks,
Dynamitri
-
well, you can go to style.css and add this:
.entry-meta-sep {display: none}Please do not open new threads on the same question – you can change the other to unresolved and continue there.
Xavortm: Sorry, I’m not sure if you got me right as your suggestion is completely unrelated to my problem (or so I think). Let me reiterate:
The top of the post looks as following:
1 SIERPNIA 2013 18:10CATEGORIES: BEZ KATEGORII \ DYNAMITRI \ EDIT
(at least that’s how I see it, probably you can’t see the “\ EDIT” bit as I’m the admin with additional privileges)
the date/time is glued to the categories and looks as following:
1 SIERPNIA 2013 18:10CATEGORIES: BEZ KATEGORII \
I want it to be like the next part of the meta data on top of the post, which is
CATEGORIES: BEZ KATEGORII \ DYNAMITRI
As per the code lifted off my content.php file, and quoted in my initial post:
CATEGORIES: BEZ KATEGORII \ DYNAMITRI
is
prana_post_category() . prana_post_author() .
Then
1 SIERPNIA 2013 18:10CATEGORIES: BEZ KATEGORII \
is
prana_post_date() . prana_post_category() .
Which, to my eyes, looks as it is following the same pattern. However,
prana_post_date() .
seems not to generate the meta entry separator at the end of it.Oddly enough,
prana_post_category() .
,prana_post_author() .
and virtually any otherprana_post_
function (_tags
,_style
etc.), all seem to generate the meta entry separator at their respective ends. Not sure why this is the case for virtually all of them, but the date function.I’m aiming to have the meta entry separator after the date (i.e. , the
prana_post_date() .
function), not to have it removed… since, well, it’s not there where I want to to be as of now.In other words, I want the top of the post to look like:
1 SIERPNIA 2013 18:10 \ CATEGORIES: BEZ KATEGORII \
(desired)Whereas now it looks the following:
1 SIERPNIA 2013 18:10CATEGORIES: BEZ KATEGORII \
(not desired)At the same time, I want to rely on the code, not on enforcing the backslash by hard-coding it into the content.php file. For some odd reason, the spacing around the “
\
” coming as a result of using the functions, is a bit larger than the one that comes from using regular backslash surrounded by regular spaces (i.e. there is discrepancy in spacing resulting from using hard-coded “\
” in one place, and code-generated meta entry separators in the other). This is even more noticeable when two different type of backslashes, for the lack of a better word, are so close to each other.Sorry, might have not made it clear, hopefully the post above outlines clearly what is it that I’m trying to achieve.
Many thanks for the help – really appreciated.
Best,
D.
Try this:
.cat-links:before { content: " \\ "; }
And you really should be using a child theme so that your changes are not lost when the theme is updated.
Thanks, but that pretty much has done what hard-coding it into the content.php file would (attempted it before but reverted the changes) – i.e. there is a difference in spacing between the first “\” and the next one. As per http://www.dynamitri.pl. No idea why this is happening or why the backslash after the date wouldn’t show up on its own.
I’ll be looking into the child themes, thanks. Would like to have it resolved first, though, so that I know at least how to proceed in the future without undue delays.
Many thanks for the help, nonetheless – really appreciated.
Best,
D.
OK, I’m halfway there. I managed to get the
\
in the desired place by injectingprana_entry_meta_sep
into the utility.php file, as per following:/** Prana Post Date */ function prana_post_date() { $post_date = esc_html( get_the_date() ) . ( prana_entry_meta_sep() ); /** Output */ $output = sprintf( '<span class="entry-date" title="%1$s"><a href="%2$s" title="%3$s" rel="bookmark">%1$s</a></span>', $post_date, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); return $output; }
however, right now – as can be seen at http://www.dynamitri.pl, the date itself is preceded by
\">
Try as I might, I cannot seem to be able to get rid of that part of the code that cropped up magically as soon as I entered the
prana_post_date()
function.Any idea what to do to clean up the code? Any suggestions will be greatly appreciated.
Thanks!
Marking as resolved, opening new thread for the issue above. Thanks a lot everyone.
OK, well, I got my new thread locked down and got directed to continue here. Below I’m posting the issue I am experiencing now. Uhhhh… So confusing, I swear mods are not really being helpful with all that, especially seeing that I had not even been notified about the closure of my previous thread! So I’ve been waiting for the replies and had it not been for me casually wandering into this board to see what’s up, I wouldn’t have even known my question has been closed. Major letdown here, folks.
Anyway, I’m now posting an update on the issue – which got resolved only 50%, and I would appreciate some feedback/suggestions.
Thank you.I have now slightly amended a part of my utility.php file, and went from:
/** Prana Post Date */ function prana_post_date() { $post_date = esc_html( get_the_date() ) . " " . esc_attr( get_the_time() ); /** Output */ $output = sprintf( '<span class="entry-date" title="%1$s"><a href="%2$s" title="%3$s" rel="bookmark">%1$s</a></span>', $post_date, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); return $output; }
to
/** Prana Post Date */ function prana_post_date() { $post_date = esc_html ( get_the_date() ) . ( prana_entry_meta_sep() ); /** Output */ $output = sprintf( '<span class="entry-date" title="%1$s"><a href="%2$s" title="%3$s" rel="bookmark">%1$s</a></span>', $post_date, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); return $output; }
What I wanted to achieve is
a) getting rid of the timestamp (as don’t really need it), and i
b) having the date followed by the backslash metadata separator (triggered by theprana_entry_meta_sep()
function.I have achieved my aim in 50%, as it can be seen on http://www.dynamitri.pl. I have the metadata separator after the date. However, for some reason, as soon as I placed the
prana_entry_meta_sep()
function in an appropriate place, some code has cropped up before the date. Code that I cannot get rid of no matter how hard I try, without reducing the site to the point of giving me syntax errors. What happens right now is the date is preceded by three characters (so, they appear before the date):\ ">
Oddly enough, they are not hyperlinked to anything (the date itself is). I went through all the .php files in my WordPress editor (not all of those on the server, mind you – didn’t get down to that yet, would take the better part of the day probably). I’ve searched for those three characters – no results there. Searched through the utility.php file that I have altered, hoping to find those 3 mysterious chars there. Again, no result.
Does anyone have any idea as to how to clean up the code, what the heck is actually generating those three characters, and how hide them? All suggestions would be greatly appreciated, I have spent last two hours trying to figure it out by trial and error and slowly running out of ideas (and then another one on waiting for help on my closed thread, amazeballs, Mods)… Thanks!
Best,
Dynamitri
OK, I’ve spent last five hours trying to figure it out on my own – to no avail. Does anyone have virtually any suggestions? Anything that might remotely do, would be really greatly appreciated (please see the post above). Thanks!
Best,
Dynamitri
[solution see http://wordpress.org/support/topic/problem-with-get_the_date-function?replies=3 ]
- The topic ‘[Theme: Prana]: Entry meta separators in posts… again’ is closed to new replies.