The default way WordPress separates different types of meta data, such as in the post meta data, is using a pipe |
. For example, Author Name | Date | Cat1, cat2, cat3
On a Wordpress site, with an existing theme, how would I go about using a comma (,
) instead of the pipe (|
) to separate the different classes of meta data?
End result, of above example, would be this: Author Name , Date , Cat1, cat2, cat3
Thanks very much.
The default way WordPress separates different types of meta data, such as in the post meta data, is using a pipe |
. For example, Author Name | Date | Cat1, cat2, cat3
On a Wordpress site, with an existing theme, how would I go about using a comma (,
) instead of the pipe (|
) to separate the different classes of meta data?
End result, of above example, would be this: Author Name , Date , Cat1, cat2, cat3
Thanks very much.
Share Improve this question asked Feb 28, 2019 at 5:01 omega33omega33 3646 silver badges20 bronze badges1 Answer
Reset to default 0The default way WordPress separates different types of meta data, such as in the post meta data, is using a pipe |. For example, Author Name | Date | Cat1, cat2, cat3
This isn't correct. WordPress doesn't have a default way that it displays this information. It's entirely up to the theme developer.
if you'd like to replace this |
character, you're going to need to modify the theme files. That is unless the theme provides its own custom way of changing this behaviour without modifying the theme. You would need to check with the theme author to know if your theme has a custom way of making this change.
If the theme was built according to best practices, you can do this modification safely by creating a Child Theme and copying the template file responsible for outputting this data into the same subdirectory in your child theme, and making the change to that file.
Without access to your specific theme, it's not possible to get more specific than that. But as an example, if you were using the latest default theme, Twenty Ninteen, then you would need to copy template-parts/header/entry-header.php
from the twentynineteen
directory, into a template-parts/header/
subdirectory in your child theme directory. Then you would add the commas between twentynineteen_posted_by()
and twentynineteen_posted_on()
.
If you're not comfortable with coding, I recommend asking the theme author for advice in making this change.