A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Setting server variables on multiple domain Magento

When adding another domain to my Magento store I needed to modify the .htaccess file:


RewriteCond %{HTTP_HOST} ^ RewriteRule ^ – [E=MAGE_RUN_CODE:shop_theblueberrypartnership_com] RewriteCond %{HTTP_HOST} ^ RewriteRule ^ – [E=MAGE_RUN_TYPE:website]

Display login or register links

Display login or register link

<?php if(is_user_logged_in()):?> <?php else: // not logged in ?> <?php wp_die('Sorry, you must first '. wp_loginout( get_permalink() ).' to view this page. You can '.wp_register( '', '').'.'); ?> <?php endif; // logged in? ?>

Flush wp_rewrite rules

As stated on WordPress Codex: Flushing the rewrite rules is an expensive operation. So it’s best to refresh your wp_rewrite rules by not using the init hook. Austin Passy chooses to Flush your rewrite rules on plugin/theme activation on checking $_GET parameters. I’ve tried it two different ways. The first option seemed to work for […]

Custom Post Type redirects to 404 page

This function from dev4press really helped me debug my custom post type redirect to a 404 page.


Place this code in your functions.php file:

function dev4press_debug_page_request() { global $wp, $template; echo '<pre>!– Request: '; echo empty($wp->request) ? "None" : esc_html($wp->request); echo ' –>'.PHP_EOL; echo '!– Matched Rewrite Rule: '; echo empty($wp->matched_rule) ? None : […]