16 Responses

  1. Rudd
    Rudd Published |

    Thoughts?

    Just awesome. Never thought of this before.

    Reply
  2. toscho
    toscho Published |

    The actions loop_start and loop_end are probably safer for this. Don’t think a priority of 0 is a guarantee: negative numbers are allowed, and they will win.

    Shortcodes for use in theme templates.

    There is one exception: Inside of PHP shortcodes are almost always useless. echo do_shortcode('[shortcode_1]'); is a common and expensive mistake, when people forget they can call the shortcode callback just by its name.

    Reply
  3. Thiago Senna
    Thiago Senna Published |

    Hi,

    I don’t like the idea to hack this kind of thing. As developer I’d like to use shortcodes as my ‘dev tools’ when creating themes (if necessary). It’s a beautiful approach to execute a function within a string content.

    I really prefer to be free when creating shortcodes besides thinking about hacks to avoid bad uses of the shortcode.

    Reply
  4. Drew Jaynes
    Drew Jaynes Published |

    I’m curious whether this is purely a semantic argument about theme vs plugin functionality.

    Is it the idea that themes shouldn’t influence content only the display of said content? If so, that’s something I can get behind. If not, it seems like such an odd argument to make — no shortcodes in post content — since that’s exactly what shortcodes are for.

    I’d also be curious to hear your stance on what shortcodes’ exit strategy should be, especially when people’s post_content is littered with leftover shortcodes. Personally, I’m kind of a fan of re-adding the shortcode and giving it an empty output.

    Reply
  5. Sarakuj
    Sarakuj Published |

    iam amazed how you cover that and described in a clean way, thank you

    Reply
  6. roni rah
    roni rah Published |

    Useful! Specially thanks for the shortcodes.

    Reply
  7. Maria watson
    Maria watson Published |

    Nice article to cover short codes in word press.. I have been using word press for blogging but never thought of this thing..This looks like more of a techie feedback..would love to follow this blog for more details on Wordpress..

    Reply
  8. Valentin
    Valentin Published |

    Just awesome, thanks for the tips !

    Reply
  9. Jason Miller
    Jason Miller Published |

    This is good, solid advice and explained very concisely. Thank you sir

    Reply
  10. Kajolcute
    Kajolcute Published |

    It’s good ! Useful! Specially thanks for the shortcodes.

    Reply
  11. How To Disallow Specific Shortcodes in Post Content
  12. Silver
    Silver Published |

    Hello,

    Good idea for your own shortcode, but my problem is mainly about ‘external’ added ones (by themes …). So do you have a solution to list ‘all’ the site shortcodes ?

    Reply
  13. Wilfried
    Wilfried Published |

    Thank’s Specially thanks for the shortcodes.

    Reply
  14. Zig
    Zig Published |

    Thanks for the code, but it doesn’t work for me.

    Reply

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.

css.php