最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - How to insert the first letter in uppercase

matteradmin7PV0评论
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 question

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?

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 question

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?

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
Add a comment  | 

1 Answer 1

Reset to default 1

I think this should do the job

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

comment list (0)

  1. No comments so far