Adaptive Blog Theme: Shortcodes
videos

Adaptive Blog Theme: Shortcodes

This entry is part 9 of 12 in the Adaptive Blog Theme: From Photoshop to WordPress Session
« PreviousNext »

Shortcodes are a popular feature for themes, and are often a great way to display certain kinds of information that may need special treatment. The optimal way to implement shortcodes is through a plugin, and that’s exactly what be covered in today’s video.


Shortcodes and Simple Plugin



Alternatively, Download the video, or subscribe to Wptuts+ screencasts via YouTube
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Razvan

    You made this shortcuts into a plugin, but what if the user changes his theme and the new theme doesn`t have that classes defined in style.css (video-container / button ) and / or other classes the you added in your plugin? Can you link a custom css file in your plugin?

    • Ivan

      in your plugin directory create custom stylesheet (style.css), Register style.css with hook ‘wp_enqueue_scripts’, which can be used for front end CSS and JavaScript. it should look like this: http://pastebin.mozilla.org/2078840

  • http://www.facebook.com/Ibrahim.Saqr Ibrahim Sakr

    very good adi .. thanks

  • http://twitter.com/martinjharvey Martin Harvey

    Shortcodes belong in a plugin. Hammer the message home Adi!
    Nice work.

  • krim belkacem

    thank you adi purdila
    some theme options page may be?
    you can leave this serie open and add to it when you learn something new about wordpress
    thank you great series!

    • Adi Purdila
      Author

      Yes, there will be a video about theme options. Actually, we’ll use the Theme Customizer for that :) Stay tuned.

  • Guest

    results for TEMPLATEPATH : Cwampwwwwordpress/wp-content/themes/jw

    results for bloginfo(‘template_url’): http://localhost/wordpress/wp-content/themes/jw

    results for bloginfo(‘template_directory’): http://localhost/wordpress/wp-content/themes/jw

    WHATS the difference of those ? when should i use which one ? please help.

  • md.arif

    results for TEMPLATEPATH : Cwampwwwwordpress/wp-content/themes/jw

    results for bloginfo(‘template_url’): http://localhost/wordpress/wp-content/themes/jw

    results for bloginfo(‘template_directory’): http://localhost/wordpress/wp-content/themes/jw

    WHATS the difference of those ? when should i use which one ? please help.

    • Adi Purdila
      Author

      There is not difference currently. I believe in older versions template_directory() was generating a different path, but right now they return the same value.

      • md.arif

        Thanks

  • http://twitter.com/emerazea emerazea

    This has been a wonderful series throughout. Adi, I can’t thank you enough for doing this. :D

    function thankAdi () {
    var grateful = true;

    while (grateful) {
    return “Thank you!”;
    }
    }();

    • Adi Purdila
      Author

      Haha, nice. Thanks :)

  • Andres

    Hey adi, what a tutorial, thanks so much. I have a question for you, so far, you have been preparing you theme for translation, are you going to show how to handle the final implementation. So far, i have been using Qtranslate, a great pluggin, but i would like to have a more “native” solution and i think its the perfect moment for that.
    Thanks again Adi

    • Adi Purdila
      Author

      I’ll touch briefly on how to make your .PO and .MO files :)

      • Andres

        great, i hope to show you my first wp project soon. thanks again

  • http://www.facebook.com/al.mcrorie Al McRorie

    tried a different button color, “yellow” for example, and found out the there were classes defined for blue and gray only.

    • Adi Purdila
      Author

      Yes, those are demo classes. You can easily add your own color classes via LESS :)

  • Denish

    Adi, thanks for this great series, Will you release final Theme in (.zip) with All the files,

    So users like me just need to download and use it ;)

    • Adi Purdila
      Author

      Yes, it will be released at the end of the series :)

      • Denish

        Great :), thanks for Quick reply. i hope you will release before Feb, because i am planning new blog with your Adptive theme :) Great work man.

        • http://wp.tutsplus.com/ Japh

          It will be! …just :)

      • Bucur Ion Niculae

        Abia astept :)

  • Bucur Ion Niculae

    This wordpress theme when ready, will be available for download? is pretty good

    • Adi Purdila
      Author

      Yes, it will be available for download :)

  • Abdelmomen Bauomy

    good job man