Subscribe to the RSS Feed
FreeWordpressThemes.us
Free WordPress Tutorials and Themes.

How to Display Code in WordPress Posts

May 13th, 2014 by admin

One of the most common problem that new WordPress users comes across is displaying code in posts. The problem occurs when a user tries to share a code snippet into their posts. By default WordPress filters out the code and it becomes impossible to read. In this article, I will show how to display code in WordPress posts.

Using HTML Entities to Display Code in WordPress Posts

HTML entities are special code that is parsed by browsers to display the character associated with that particular entity. For example:

  • & becomes &
  • &lt; becomes <
  • &gt; becomes >

Using HTML entities you can display code inside your WordPress posts.

&lt;div class="awesome"&gt; will be displayed in browser like this:

<div class="awesome">

This method is particularly useful if you just want to display a couple of lines of code. However, this method can be difficult to apply manually for multiple lines of code.

To solve this problem you can use an online HTML Entities encoder, like this one. Simply put the code you want to convert and hit the encode button. It will convert your code into HTML entities and you can safely paste that code inside <code></code> tag.

Using Plugin To Display Code in WordPress Posts

If you frequently share code snippets in your posts, then the above mentioned methods are not going to work for you. First thing you need to do is install and activate the SyntaxHighlighter Evolved plugin. It will save you from the hassle of converting code into HTML entities. Not only that it will highlight the code to display it in a much more readable format.

It works out of the box, all you need to do is wrap your content around specific language tags. For example, if you are sharing a code that is mainly in PHP, then you would wrap your code like this:

[php]
<?php
function themelab_demo_code() {
$i = 1;
while ($i <= 10):
echo $i."<br />";
$i++;
endwhile;
}
themelab_demo_code();
?>
[/php]

It will appear on your site, like this:

<?php
function themelab_demo_code() { 
$i = 1;
while ($i <= 10):
    echo $i."<br />";
    $i++;
endwhile;
}
themelab_demo_code();
?>

For different languages there are different aliases that you can use. Some of the most commonly used aliases are:

  • To display HTML code use [html] [/html]
  • For CSS use this: [css][/css]
  • For MySQL use this: [sql][/sql]
  • For Javascript use this: [javascript][/javascript]

I hope this article helped you display code in WordPress posts and pages.

If you liked this article, then join ThemeLab on Twitter and Google+.

The post How to Display Code in WordPress Posts appeared first on ThemeLab.

Written by - Visit Website

Posted in Theme Labs | No Comments »

How to Display Code in WordPress Posts

May 13th, 2014 by admin

One of the most common problem that new WordPress users comes across is displaying code in posts. The problem occurs when a user tries to share a code snippet into their posts. By default WordPress filters out the code and it becomes impossible to read. In this article, I will show how to display code in WordPress posts.

Using HTML Entities to Display Code in WordPress Posts

HTML entities are special code that is parsed by browsers to display the character associated with that particular entity. For example:

  • &amp; becomes &
  • &lt; becomes <
  • &gt; becomes >

Using HTML entities you can display code inside your WordPress posts.

&lt;div class="awesome"&gt; will be displayed in browser like this:

<div class="awesome">

This method is particularly useful if you just want to display a couple of lines of code. However, this method can be difficult to apply manually for multiple lines of code.

To solve this problem you can use an online HTML Entities encoder, like this one. Simply put the code you want to convert and hit the encode button. It will convert your code into HTML entities and you can safely paste that code inside <code></code> tag.

Using Plugin To Display Code in WordPress Posts

If you frequently share code snippets in your posts, then the above mentioned methods are not going to work for you. First thing you need to do is install and activate the SyntaxHighlighter Evolved plugin. It will save you from the hassle of converting code into HTML entities. Not only that it will highlight the code to display it in a much more readable format.

It works out of the box, all you need to do is wrap your content around specific language tags. For example, if you are sharing a code that is mainly in PHP, then you would wrap your code like this:

[php]
<?php
function themelab_demo_code() {
$i = 1;
while ($i <= 10):
echo $i."<br />";
$i++;
endwhile;
}
themelab_demo_code();
?>
[/php]

It will appear on your site, like this:

<?php
function themelab_demo_code() { 
$i = 1;
while ($i <= 10):
    echo $i."<br />";
    $i++;
endwhile;
}
themelab_demo_code();
?>

For different languages there are different aliases that you can use. Some of the most commonly used aliases are:

  • To display HTML code use [html] [/html]
  • For CSS use this: [css][/css]
  • For MySQL use this: [sql][/sql]
  • For Javascript use this: [javascript][/javascript]

I hope this article helped you display code in WordPress posts and pages.

If you liked this article, then join ThemeLab on Twitter and Google+.

The post How to Display Code in WordPress Posts appeared first on ThemeLab.

Written by - Visit Website

Posted in Theme Labs | No Comments »

How to Use WordPress Theme Customizer To Modify Themes

May 12th, 2014 by admin

All ThemeLab themes allow users to customize their WordPress sites using the built-in Theme Customizer. Theme Customizer provides developers an easier way to replace theme option panels. But more importantly, it is easier for the end user to setup themes with live preview without even activating a theme. In this article, I will show you how to use WordPress theme customizer to modify themes.

Before we get started, please keep this in mind that not all WordPress themes use theme customizer. Some WordPress themes have their own options panel. However, recently more and more theme developers are utilizing theme customizer.

For the sake of this tutorial, I am using our first free theme Slipstream. It is a fully responsive theme for blogs and personal websites.

To launch theme customizer in WordPress, you need to click on Appearance menu to view all installed themes on your site. You will notice that your currently active theme has a customize button. Clicking on the button will launch the theme customizer. You can also launch theme customizer for any of your currently installed themes. Just take mouse over to a theme, and then click on Live Preview button. However, any changes you make to an inactive theme in Live Preview can only be stored by activating the theme.

Customizing WordPress themes using Theme Customizer

Theme customizer screen is divided into two sections. On your right, you will see a live preview of your site. On the left, you will find different sections that you can customize through theme customizer.

WordPress theme customizer with live preview

Clicking on a section in theme customizer will expand it to show you the settings for that section. For example, in the screenshot below you can see Background Image section expanded in Slipstream’s Theme Customizer view.

Theme control expanded

Some of the most common theme customizer controls are

  • Site Title and Tag Line – Allows you to change site title and tagline.
  • Colors – Choose colors for different areas in site layout.
  • Header Image – Set an image in the header.
  • Background Image – Set a background image for all pages in your theme.
  • Widgets – One Widgets section for each widget ready area in your theme.

The options in available in theme customizer may differ from theme to theme.

Setting Widgets in WordPress Theme Customizer

WordPress 3.9 introduced live widget previews, which allows you to set up widgets directly from theme customizer. Setting up widgets in theme customizer is easier and a little faster than adding them from the Widgets screen.

Simply click on a Widgets area to expand it. If the widget area already contains widgets, then theme customizer will display those widgets. You rearrange widget order by simply dragging widgets. You will also see a +Add Widget button at the bottom.

Expanded widget area in theme customizer

Clicking on the Add Widget button will display a new column to the right containing all the available widgets that you can add to your sidebars/widget ready area. Just click on the widget you want to add and it will appear in your widget area.

Adding widget from available widgets in theme customizer

You can also edit widgets in theme customizer. Just click on the downward arrow next to any widget in your widget area and it will expand to show you the widget options. You can edit the widget while viewing a live preview of it. You can also remove a widget at any time by clicking on the delete link.

Editing widgets in WordPress theme customizer

As the usage of theme customizer becomes popular among developers we can hope that it will become the default theme options panel in the future. We can also hope that we will be seeing innovative usage of theme customizer in the plugins as well. This will provide users a standard location and method to customize their themes.

I hope that this article helped you learn how to use theme customizer to modify WordPress themes.

If you liked this article, then join ThemeLab on Google+ and Twitter.

The post How to Use WordPress Theme Customizer To Modify Themes appeared first on ThemeLab.

Written by - Visit Website

Posted in Theme Labs | No Comments »

How to Use WordPress Theme Customizer To Modify Themes

May 12th, 2014 by admin

All ThemeLab themes allow users to customize their WordPress sites using the built-in Theme Customizer. Theme Customizer provides developers an easier way to replace theme option panels. But more importantly, it is easier for the end user to setup themes with live preview without even activating a theme. In this article, I will show you how to use WordPress theme customizer to modify themes.

Before we get started, please keep this in mind that not all WordPress themes use theme customizer. Some WordPress themes have their own options panel. However, recently more and more theme developers are utilizing theme customizer.

For the sake of this tutorial, I am using our first free theme Slipstream. It is a fully responsive theme for blogs and personal websites.

To launch theme customizer in WordPress, you need to click on Appearance menu to view all installed themes on your site. You will notice that your currently active theme has a customize button. Clicking on the button will launch the theme customizer. You can also launch theme customizer for any of your currently installed themes. Just take mouse over to a theme, and then click on Live Preview button. However, any changes you make to an inactive theme in Live Preview can only be stored by activating the theme.

Customizing WordPress themes using Theme Customizer

Theme customizer screen is divided into two sections. On your right, you will see a live preview of your site. On the left, you will find different sections that you can customize through theme customizer.

WordPress theme customizer with live preview

Clicking on a section in theme customizer will expand it to show you the settings for that section. For example, in the screenshot below you can see Background Image section expanded in Slipstream’s Theme Customizer view.

Theme control expanded

Some of the most common theme customizer controls are

  • Site Title and Tag Line – Allows you to change site title and tagline.
  • Colors – Choose colors for different areas in site layout.
  • Header Image – Set an image in the header.
  • Background Image – Set a background image for all pages in your theme.
  • Widgets – One Widgets section for each widget ready area in your theme.

The options in available in theme customizer may differ from theme to theme.

Setting Widgets in WordPress Theme Customizer

WordPress 3.9 introduced live widget previews, which allows you to set up widgets directly from theme customizer. Setting up widgets in theme customizer is easier and a little faster than adding them from the Widgets screen.

Simply click on a Widgets area to expand it. If the widget area already contains widgets, then theme customizer will display those widgets. You rearrange widget order by simply dragging widgets. You will also see a +Add Widget button at the bottom.

Expanded widget area in theme customizer

Clicking on the Add Widget button will display a new column to the right containing all the available widgets that you can add to your sidebars/widget ready area. Just click on the widget you want to add and it will appear in your widget area.

Adding widget from available widgets in theme customizer

You can also edit widgets in theme customizer. Just click on the downward arrow next to any widget in your widget area and it will expand to show you the widget options. You can edit the widget while viewing a live preview of it. You can also remove a widget at any time by clicking on the delete link.

Editing widgets in WordPress theme customizer

As the usage of theme customizer becomes popular among developers we can hope that it will become the default theme options panel in the future. We can also hope that we will be seeing innovative usage of theme customizer in the plugins as well. This will provide users a standard location and method to customize their themes.

I hope that this article helped you learn how to use theme customizer to modify WordPress themes.

If you liked this article, then join ThemeLab on Google+ and Twitter.

The post How to Use WordPress Theme Customizer To Modify Themes appeared first on ThemeLab.

Written by - Visit Website

Posted in Theme Labs | No Comments »

How to Use WordPress Theme Customizer To Modify Themes

May 12th, 2014 by admin

All ThemeLab themes allow users to customize their WordPress sites using the built-in Theme Customizer. Theme Customizer provides developers an easier way to replace theme option panels. But more importantly, it is easier for the end user to setup themes with live preview without even activating a theme. In this article, I will show you how to use WordPress theme customizer to modify themes.

Before we get started, please keep this in mind that not all WordPress themes use theme customizer. Some WordPress themes have their own options panel. However, recently more and more theme developers are utilizing theme customizer.

For the sake of this tutorial, I am using our first free theme Slipstream. It is a fully responsive theme for blogs and personal websites.

To launch theme customizer in WordPress, you need to click on Appearance menu to view all installed themes on your site. You will notice that your currently active theme has a customize button. Clicking on the button will launch the theme customizer. You can also launch theme customizer for any of your currently installed themes. Just take mouse over to a theme, and then click on Live Preview button. However, any changes you make to an inactive theme in Live Preview can only be stored by activating the theme.

Customizing WordPress themes using Theme Customizer

Theme customizer screen is divided into two sections. On your right, you will see a live preview of your site. On the left, you will find different sections that you can customize through theme customizer.

WordPress theme customizer with live preview

Clicking on a section in theme customizer will expand it to show you the settings for that section. For example, in the screenshot below you can see Background Image section expanded in Slipstream’s Theme Customizer view.

Theme control expanded

Some of the most common theme customizer controls are

  • Site Title and Tag Line – Allows you to change site title and tagline.
  • Colors – Choose colors for different areas in site layout.
  • Header Image – Set an image in the header.
  • Background Image – Set a background image for all pages in your theme.
  • Widgets – One Widgets section for each widget ready area in your theme.

The options in available in theme customizer may differ from theme to theme.

Setting Widgets in WordPress Theme Customizer

WordPress 3.9 introduced live widget previews, which allows you to set up widgets directly from theme customizer. Setting up widgets in theme customizer is easier and a little faster than adding them from the Widgets screen.

Simply click on a Widgets area to expand it. If the widget area already contains widgets, then theme customizer will display those widgets. You rearrange widget order by simply dragging widgets. You will also see a +Add Widget button at the bottom.

Expanded widget area in theme customizer

Clicking on the Add Widget button will display a new column to the right containing all the available widgets that you can add to your sidebars/widget ready area. Just click on the widget you want to add and it will appear in your widget area.

Adding widget from available widgets in theme customizer

You can also edit widgets in theme customizer. Just click on the downward arrow next to any widget in your widget area and it will expand to show you the widget options. You can edit the widget while viewing a live preview of it. You can also remove a widget at any time by clicking on the delete link.

Editing widgets in WordPress theme customizer

As the usage of theme customizer becomes popular among developers we can hope that it will become the default theme options panel in the future. We can also hope that we will be seeing innovative usage of theme customizer in the plugins as well. This will provide users a standard location and method to customize their themes.

I hope that this article helped you learn how to use theme customizer to modify WordPress themes.

If you liked this article, then join ThemeLab on Google+ and Twitter.

The post How to Use WordPress Theme Customizer To Modify Themes appeared first on ThemeLab.

Written by - Visit Website

Posted in Theme Labs | No Comments »