Articles for WordPress

Tweet Before reading this article it is advised to read “How to run Magento in WordPress“, as it could help you overcome some basic problems that might emerge. This snippet shows you how to get Magento categories and show them in WordPress so you can use them as a menu. Copy following snippet into your [...]

Tweet Many developers like combining Magento and WordPress, and there is many more out there that would like to. All snippets showing how to grab data from Magento don’t warn you that there is the function in Magento core that has the same name as WordPress function for translation “__()”. For this reason it is [...]

Tweet In order to convert category ID to category name in WordPress, you can use get_cat_name(). This is a WordPress function that will help you get category name based on category ID. It can be used when you know category name might be changed, and you know ID will stay the same. See snippet below [...]

Tweet When making customization for our WordPress theme, often we need to check if user is logged in. It is a simple task when using a WordPress function is_user_logged_in(). Here is a simple snippet that shows you how to check if user is logged in or not. 1 2 if(is_user_logged_in()) echo ‘You are logged in.’; [...]

Tweet If you would like to present number of posts on your WordPress blog – than you could use WP function called wp_count_posts(). And if you want to just count published posts, follow the snippet below: echo ‘So far – we have published: ‘ . wp_count_posts()->publish . ‘ posts!’; Example of count posts Stunt snippets [...]

Tweet WordPress shortcodes are powerful but rarely used functions. It is simple to use WordPress shortcodes by calling WordPress function add_shortcode. You can use it to show your sharing buttons, RSS feeds, Google AdSense or just your signature. To make this simple function works with you – just copy following snippet into your themes functions.php [...]

Tweet Facebook sharing is just getting more and more popular, and it is good to let your visitors share content on your blog using their Facebook profile. Facebook share button is easy to use – as copying this snippet and pasting it into your website. This way you can customize you Facebook share button by [...]

Tweet As I was surfing the net I have stumbled upon Jeffrey Way’s theme options page. Basic and simple option page that let’s you download the code in order to start making your own options page on your custom theme. If you are into WordPress – one day you will need it – so better [...]

Tweet Sometimes there is a need to get posts outside of WordPress. In order to get latest couple of posts and present them as news outside of WP, I have written a function that might be useful. This function has two parameters. First one is database connection, and second is optional array of parameters used [...]

Make Magento Checkout Awesome