Tag Archives: WordPress tutorial

How to Use the New Custom Menu Feature in WordPress 3.0

http://www.sitepoint.com/blogs/2010/07/06/how-to-use-the-new-custom-menu-feature-in-wordpress-3-0/

WordPress – Moving WP site to a subdomain

http://codex.wordpress.org/Moving_WordPress

WordPress Tutorial – WP e-Commerce: Setting Shipping Rates

Setting a shipping rate that correctly displays in both the shopping cart AND the sidebar Widget!

Step 1:
WP e-Commerce Admin > Settings > Shipping:

  • In the General Settings section, set Use Shipping to Yes and type ZIP code in the Base Zipcode/Postcode box.
  • Then tick the check-box next to Flat Rate in the Shipping Modules section.
  • Next, click the invisible “edit” link that’s located to the right of Flat Rate and make sure both of the Base Local boxes are empty.

Step 2:
WP e-Commerce Admin > Settings > Products:

  • In the Edit Product column, in the Shipping Details section, type the shipping price in the Flat Rate Settings/Local Shipping Fee box.

WordPress Tutorial – WP e-Commerce 3.7.5 RC3: Change “P&P” text to “S&H” for Shipping & Handling

UPDATE (Aug 2, 2010): Click for the newest info for changing P&P to S&H in WP e-Commerce version 3.7.6.7

WordPress Tutorial – WP e-Commerce 3.7.4: Change "P&P" text to "S&H" for Shipping & Handling

UPDATE (Aug 2, 2010): Click for the newest info for changing P&P to S&H in WP e-Commerce version 3.7.6.7

WordPress Tutorial – Remove the Word "Protected:" from Title Text of Password-protected Pages

Remove the word “Protected:” from title text of password-protected pages.

Big thanks to t31os on the WordPress forums. Check out t31os’s site for more WordPress tips.

The following filter function code is placed in the functions.php file, this way it doesn’t accidentally get replaced when WordPress is upgraded.

<?php
function the_title_trim($title)
{
$pattern[0] = ‘/Protected:/’;
$pattern[1] = ‘/Private:/’;
$replacement[0] = ”; // Enter some text to put in place of Protected:
$replacement[1] = ”; // Enter some text to put in place of Private:

return preg_replace($pattern, $replacement, $title);
}
add_filter(‘the_title’, ‘the_title_trim’);
?>

NOTE: I had to remove the *<?php* and *?>* tags from the above code and place the function code inside my existing *<?php* and *?>* tags that were already in my functions.php file. Otherwise, it messed up my Multi-level Navigation Plugin for WordPress (which I’m a big fan of).

WordPress version: 2.8.1 RC1

Integrate WordPress Blog into Magento Ecommerce using Lazzymonks WordPress Integration 2.61 Extension

Integrate WordPress Blog into Magento Ecommerce Shopping Cart using Lazzymonks WordPress Integration 2.61 Extension
Successfully installed Oct 21, 2008
Application versions: Magento 1.1.6 & WordPress 2.6.2
Hosted on 1&1 Internet

This extension adds the ability to integrate WordPress blog into Magento.
It has adjustable page layout from with in the WordPress admin menu.
Wordpress menu can be set to show in the left column, right column, both or neither.
A link in the Magento footer can be enabled or disabled.
And the page title can also be set.
When everything is setup, separate WordPress login and Magento login is still required to operate each application.

1. Install working version of Magento Ecommerce first

2. Upload WordPress directory into a Magento sub-directory called “wordpress” (magento/wordpress)

3. Add Magento’s DB info to WordPress’s wp-config.php file (this is the same MySQL database that all the Magento files are already in – you’ll be mixing the WordPress files in with the Magento files in the pre-existing Magento database)

4. Acquire the Lazzymonks WordPress Integration 2.61 Extension “key” from Magento Connect. The “key” is currently called: magento-community/Mage_Blog

5. In Magento’s admin, go to the Magento Connect Manager (System > Magento Connect > Magento Connect Manager), login in again, click on the Settings tab and change the Preferred State to “beta”

6. Click on the Extensions tab and paste “magento-community/Mage_Blog” (without the quotes) into the “Paste extension key to install:” box and click Install. (The new WordPress integration extension should show up at the bottom of the page)

7. Click on the Settings tab again and change the Preferred State back to “stable”

8. Go back to Lazzymonks WordPress Integration 2.61 Extension page and follow the instructions starting about half-way down the page (or see #9 below, which is taken from Lazzymonks page)

9. Two of the following files and the theme folder can be found in the Magento base directory, in a folder called “wordpress_module_files” (this folder was installed in Magento’s base directory during the WP Integration extension installation in the Magento Connect Manager). Copies of these files, with “some” of the changes already applied, are included in the extension files (which are in the “wordpress_module_files” folder). These files, however, should be used with caution – double-check all of these files in the “wordpress_module_files” folder against what Lazzymonk recommends on his Magento extension Web page (http://www.magentocommerce.com/extension/296/lazzymonks-wordpress-integration)

9.1. Find index.php in the root of your Magento installation and find the following line of code:

require_once $mageFilename;

And add the following after it:

define(‘WP_USE_THEMES’, true);
require(‘./wordpress/wp-blog-header.php’);

(You will need to be sure that the second line points to the location of your WordPress installation, as it is, it assumes WordPress is installed in the Magento directory.)

9.2. In wordpress/wp-settings.php find the following lines of code and remove the & symbol

Around line 399 (line 472 in WP v2.6.2):

$wp_the_query =& new WP_Query();

Around line 414 (line 487 in WP v2.6.2):

$wp_rewrite =& new WP_Rewrite();

Around line 421 (line 494 in WP v2.6.2):

$wp =& new WP();

Around line 456 (line 530 in WP v2.6.2):

$wp_locale =& new WP_Locale();

9.3 Also in wordpress/wp-settings.php remove or comment out the following lines, around line 386 (line 459 in WP v2.6.2):

// Escape with wpdb.
$_GET = add_magic_quotes($_GET );
$_POST = add_magic_quotes($_POST );
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);

9.4. In wordpress/wp-includes/l10n.php at line 116

Change:

function __($text, $domain = ‘default’) {
return translate($text, $domain);
}

To:

if (!function_exists(‘__’)) {
function __($text, $domain = ‘default’) {
return translate($text, $domain);
}
}

9.5. Now, on to the WordPress part: Copy the “magento” theme in the wordpress_module_files/wordpress-theme folder into the wordpress/wp-content/themes folder.

9.6. Log into the admin panel of WordPress and click the “settings” link. Then, change the “Blog address (URL)” to: http://yoursite.com/magento/blog (or, change it to fit your site), but leave the “blog” directory part in the URL. Save settings. Then, click the permalinks tab and ensure that permalinks are set to default. Finally, click on the “design” link and select the WordPress Magento theme installed in step 9.5.

9.7. Now go to http://yoursite.com/magento/blog to access the blog. Mine is actually located at http://www.aqwearium.com/blog, without the extra magento directory in the URL

10. Configuring the WP Integration in Magento’s back-end admin: System > Configuration > Blog (under the General tab in the left-hand menu)