Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Cómo añadir CSS de Twitter Bootstrap en WordPress usando shortcodes

Nota editorial: Ganamos una comisión de los enlaces de socios en WPBeginner. Las comisiones no afectan a las opiniones o evaluaciones de nuestros editores. Más información sobre Proceso editorial.

Si añades elementos CSS como información emergente, botones de colores y efectos roll-over, tu contenido destacará. El problema es que la mayoría de la gente no sabe cómo usar CSS para añadir botones de colores, tablas, etiquetas, etc. Le hemos mostrado cómo añadir widgets y tablas de colores en WordPress. En este artículo, le mostraremos cómo utilizar Twitter Bootstrap CSS en WordPress utilizando shortcodes.

Twitter Bootstrap es un framework CSS y JavaScript que ayuda a impulsar el diseño y la funcionalidad de su sitio rápidamente. Fue desarrollado por Mark Otto y Jacob Thornton en Twitter como un marco para fomentar la coherencia entre sus herramientas internas. Más tarde se publicó como herramienta de código abierto. Es bonito, sencillo y compatible con todos los navegadores.

Lo primero que tienes que hacer es instalar y activar el plugin WordPress Twitter Bootstrap CSS. Una vez activado, el plugin añadirá un elemento / artículo de menú de Twitter Bootstrap en tu administrador de WordPress. Al hacer clic en él, accederás al panel de control del plugin.

Bootstrap Menu

En el dashboard, verás un montón de anuncios añadidos por el autor del plugin. Desplázate más allá de ellos, y verás los shortcodes que puedes añadir en tus entradas. Cada shortcode está enlazado a la página de soporte del plugin donde puedes ver más ejemplos de uso de estos shortcodes.

Bootstrap shortcode usage examples

Bajo el elemento / artículo del menú Twitter Bootstrap en tu administrador, hay un enlazar para configurar los ajustes CSS de Bootstrap. Al hacer clic en él, accederás a la página de configuración, donde podrás cambiar los ajustes para adaptarlos a tus necesidades. Tienes la opción de elegir qué versión de Bootstrap CSS quieres utilizar. Debajo encontrarás opciones más adecuadas para usuarios de nivel avanzado.

Ahora que ya hemos visto la configuración, vamos a añadir algunos elementos css de Bootstrap a una entrada del blog. Simplemente pega los shortcodes así en el contenido de tu entrada o página:

<!--Shortcodes->
[TBS_BUTTON id="mySpecialButton" color="primary" class="btn-large" link="http://example.com"]Download[/TBS_BUTTON]
[TBS_BUTTON id="mySpecialButton" color="danger" link="http://example.com"]Cancel[/TBS_BUTTON]
[TBS_BUTTON id="mySpecialButton" color="success" link="http://example.com"]Learn more[/TBS_BUTTON]
Icons:
[TBS_ICON class="icon-globe"]
[TBS_ICON class="icon-globe"]
[TBS_ICON class="icon-chevron-right"]
[TBS_ICON class="icon-music"]
[TBS_ICON class="icon-film"]
[TBS_ICON class="icon-user"]
[TBS_ICON class="icon-wrench"]
[TBS_LABEL class="warning"]Warning: Label[/TBS_LABEL] 
[TBS_LABEL class="danger"]Danger: Label[/TBS_LABEL] 
[TBS_LABEL class="success"]Green: Label[/TBS_LABEL] 
[TBS_ALERT class="success"]Settings saved[/TBS_ALERT]

Así es como se verán estos shortcodes en la entrada del blog:

Twitter bootstrap css elements added to a post

Hay muchos más elementos CSS que puedes añadir a tus entradas. Información emergente, menús de acordeón, ventanas emergentes, barras de progreso, etc. El sitio web de este plugin tiene más documentación sobre cómo utilizar estas características. Si tienes curiosidad acerca de los iconos, entonces puedes mirar en el sitio oficial de Twitter Bootstrap para ver el conjunto completo de iconos que puedes utilizar.

Sabemos que los frameworks de temas como Genesis y otros vienen con sus propias opciones. ¿Utilizas elementos CSS en tus entradas? Háznoslo saber dejando un comentario a continuación.

Descargo: Nuestro contenido está apoyado por los lectores. Esto significa que si hace clic en algunos de nuestros enlaces, podemos ganar una comisión. Vea cómo se financia WPBeginner , por qué es importante, y cómo puede apoyarnos. Aquí está nuestro proceso editorial .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

El último kit de herramientas de WordPress

Obtenga acceso GRATUITO a nuestro kit de herramientas - una colección de productos y recursos relacionados con WordPress que todo profesional debería tener!

Reader Interactions

10 comentariosDeja una respuesta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. kezzy says

    Thanks for this post. I have been using theme built on bootstrap framework and the process is straight forward rather than to input shortcodes here and there. Anyway will it not be easier to enqueue bootstrap script and style to a theme header and achieve the same result?

    • WPBeginner Support says

      Deprito, Genesis is itself a Theme Framework and getting Twitter Bootstrap to work on Genesis would require additional steps. Try Genesis support forums, someone must have already done that.

      Administrador

  3. James Matthews says

    Amazing tutorial. Cleared up a lot of confusion that I had about twitter bootstrap. Parts of bootstrap are still difficult for me to understand, but this will definitely be really useful as I start to become more familiar with it.

  4. Steven Blake mba says

    Thanks for what I am sure must be a good article. I find it quite frustrating the amount of articles I could really be interested in that forget or don’t realise that the use of buzz words that you deal with every day might not be understood by anyone who hasn’t come across it before. I try not to do this in my own work as a life coach, which if I advertised as being an NLP practitioner I would put off 90% of people who don’t know what that is.

    So unfortunately until I understand what a twitter boot strap is I really don’t need the detail of how to install it. It may be I am missing out, but I don’t have the time to research any more than I already do and I did arrive here at your article, I just don’t want to have to look up several more before I return!

    Just one line explaining what it does and the benefits of having a twitter boot strap would be the difference between me reading on instead of moving on.

    This is constructive criticism by the way, add the description in this and any subsequent blogs and watch your outcomes improve. Best wishes, Steven

    • Noumaan Yaqoob says

      @Steven Twitter bootstrap is a set of predefined design tools which helps other designers and developers to use those elements in their own projects.

      The purpose of this article and the plugin is to help users like yourself to use twitter bootstrap without learning code or css.

  5. craig grella says

    great post, thanks. I’ve used bootstrap and ported it for thesis and a few other themes, but this will be handy for sites that dont need the framework – just the buttons and icons.

    nice catch!

Deja tu comentario

Gracias por elegir dejar un comentario. Tenga en cuenta que todos los comentarios son moderados de acuerdo con nuestros política de comentarios, y su dirección de correo electrónico NO será publicada. Por favor, NO utilice palabras clave en el campo de nombre. Tengamos una conversación personal y significativa.