I had a hard time figuring how to make wordpress display backslashes in posts. There are 2 solutions for this problem:
- Use html code for backslash which is \
- Use double backslashes like \\
The html code must be inserted from “HTML” view, which might be a little inconvenient while the double backslashes can be used in the “Visual” view.
Cippo posted it on
02/08/2010,
under: Wordpress.
I’ve recently installed the TinyMCE Advanced plugin and when I tried to set properties for my titles, I got something like this:
<h3 class="\"test-class\""> instead of
<h3 class="test-class"> so I asked google about it.
I’ve got the following solution, to strip slashes from all the posts:
add_filter('the_content', 'my_strip_slashes');
function my_strip_slashes($content)
{
return stripslashes($content);
}
Place the code above in your functions.php file and your problems are solved. No more headaches.
Cippo posted it on
01/08/2010,
under: Wordpress.
You have to build a website for a restaurant and you have chosen WordPress to do the job. It’s time to add restaurant’s products but you have to classify them. Well there’s a very easy way to do that.
What products does a restaurant have? Well, I think a regular restaurant has Breakfast, Launch, Dinner, Beverage and Dessert.
Open functions.php from your wordpress theme directory and add the following code:
function create_menu_categories() {
register_taxonomy(‘menu_type’, ‘post’, array(‘hierarchical’=>;false, ‘label’=>’Menu type’, ‘query_var’=>true, ‘rewrite’=>true));
}
add_action(‘init’, ‘create_menu_categories’, 0);
Query for posts, using custom tag
To display only posts that have a specific tag from your custom taxonomies, place the code [..] curious to read more?
Cippo posted it on
19/07/2010,
under: Wordpress.