Articles tagged with: Wordpress
Posted: Apr 19 | Filed under: Wordpress
To realize a multilingual wordpress you have to follow the following steps:
1. Check if your theme is ready for localization.
To do that open for example comments.php in your theme folder and search for text that is currently displayed on your blog e.g.”Leave a comment”.
If it’s looking similar to
" _e("Leave a comment", "mytheme"); "
then your theme should already be ready for localization.
2. Optional
If not then you will have to wrap the “_e” around every text passage in your theme. Replace mytheme with your theme’s name. Also don’t forget that this has to be inside a php statement!
You can do it like that:
<?php _e("Text", "mytheme"); ?>
Inside a function:
'__('Text', "mytheme")'
e.g.
comments_rss_link(__('Subscribe to the comments via RSS Feed', "mytheme"));
3. Add load_theme_textdomain to your functions.php
This is a very important step because it will load the text via gettext before sending out the headers. Add the following at the very first line of your functions.php inside your theme folder: (if you don’t have one create a functions.php!)
<?php load_theme_textdomain('mytheme'); ?>
Posted: Apr 07 | Filed under: Wordpress
If you are looking for a solution to exclude subcategories, here is a very simply way:
$categories= get_categories(); foreach ($categories as $cat) { if($cat->category_parent == 0){ DO WHATEVER YOU WANT TO DO } }
You could use this code to make a dropdown box without subcategories.
Here is the wordpress reference for “get_categories” with an example of a categories dropdown box.
Dropdown box
Posted: Mar 30 | Filed under: Wordpress
One of the most important thing for a wordpress developer is to know where the user is right now. The wordpress reference has a very important site that shows all the necessary functions to do that.
That links is definetly a must-have-bookmark for every WP developer!
Posted: Mar 27 | Filed under: Wordpress
A lot of people are sick of the wordpress editor because it will mess up their posts.
Here is the solution that worked for me. I do not say that this will work for anyone. A lot of people don’t want to turn of the Visual Editor to quickly edit their posts, but you will have to.
Turn it off Go to “Users” -> “Your Profile” and uncheck “Use the visual editor when writing”.
Posted: Mar 27 | Filed under: Wordpress
Here’s the code to save the current wordpress tag, if you are on a “tag site”:
<?php $current_tag = single_tag_title(”", false); ?>
Taken from the wordpress reference.
Posted: Mar 27 | Filed under: Wordpress
HowTo enable/disable wordpress comments via PHPMyAdmin:
Enable:
UPDATE wp_posts SET comment_status = ‘open’, ping_status = ‘open’ WHERE comment_status = ‘closed’;
Disable:
UPDATE wp_posts SET comment_status = ‘closed’, ping_status = ‘closed’ WHERE comment_status = ‘open’;


