short 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?


closed as off-topic by Jacob Peattie, fuxia Apr 10 at 1:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    ucfirst – Rup Apr 8 at 8:57
  • @Rup ou, you're right, I focused on just one wordpress function or something like that. Thank you – Dario B. Apr 8 at 9:04
  • You can just use CSS to text-transform:capitalize – Vishwa Apr 8 at 10:31

I think this should do the job

<?php echo ucfirst(get_the_title()) .' - '.get_post_type( get_the_ID() ) ;?>

Not the answer you're looking for? Browse other questions tagged or ask your own question.