WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Example I want combine shortcode for first paragraph and dropcap.

function st_dropcap( $atts, $content = null ) {
    return '<span class="dropcap">'.$content.'</span>';
add_shortcode('dropcap', 'st_dropcap');

function st_paragraph( $atts, $content = null ) {
    return '<p class="first-paragraph">'.$content.'</p>';
add_shortcode('paragraph', 'st_paragraph');

On post I tried something like this

[paragraph][dropcap]W[/dropcap]elcome to my blog[/paragraph]

Only paragraph is working. How do I combine this code?

Let me know

share|improve this question
up vote 3 down vote accepted

Change st_paragraph() to this:

function st_paragraph( $atts, $content = null ) {
    return '<p class="first-paragraph">'.do_shortcode($content).'</p>';

See Codex documentation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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