Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionshort question, I have a variable concatenated with a get_the_title and get_the_category, and I need the get_the_category to show the first letter in capital letters.
<?php echo get_the_title().' - '.get_post_type( get_the_ID() ) ; ?>
Anyone have an idea?
Thank-
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionshort question, I have a variable concatenated with a get_the_title and get_the_category, and I need the get_the_category to show the first letter in capital letters.
<?php echo get_the_title().' - '.get_post_type( get_the_ID() ) ; ?>
Anyone have an idea?
Thank-
Share Improve this question asked Apr 8, 2019 at 8:49 Dario B.Dario B. 15510 bronze badges 3- 1 ucfirst – Rup Commented Apr 8, 2019 at 8:57
- @Rup ou, you're right, I focused on just one wordpress function or something like that. Thank you – Dario B. Commented Apr 8, 2019 at 9:04
- You can just use CSS to text-transform:capitalize – Vishwa Commented Apr 8, 2019 at 10:31
1 Answer
Reset to default 1I think this should do the job
<?php echo ucfirst(get_the_title()) .' - '.get_post_type( get_the_ID() ) ;?>