Using WordPress code outside of WordPress Finally

October 30, 2012 § Leave a comment

I believe you came across with this, simply not working at all :[.

After messing around, I found couple recipes.

In every page, put this on top.

/* Short and sweet */
define('WP_USE_THEMES', false);
global $domain, $path, $base, $admin_page_hooks, $ajax_results, $all_links, $allowedposttags, $allowedtags, $authordata, $bgcolor, $cache_categories, $cache_lastcommentmodified, $cache_lastpostdate, $cache_lastpostmodified, $cache_userdata, $category_cache, $class, $comment, $comment_cache, $comment_count_cache, $commentdata, $current_user, $day, $debug, $descriptions, $error, $feeds, $id, $is_apache, $is_IIS, $is_macIE, $is_winIE, $l10n, $locale, $link, $m, $map, $max_num_pages, $menu, $mode, $month, $month_abbrev, $monthnum, $more, $multipage, $names, $newday, $numpages, $page, $page_cache, $paged, $pagenow, $pages, $parent_file, $preview, $previousday, $previousweekday, $plugin_page, $post, $post_cache, $post_default_category, $post_default_title, $post_meta_cache, $postc, $postdata, $posts, $posts_per_page, $previousday, $request, $result, $richedit, $single, $submenu, $table_prefix, $targets, $timedifference, $timestart, $timeend, $updated_timestamp, $urls, $user_ID, $user_email, $user_identity, $user_level, $user_login, $user_pass_md5, $user_url, $weekday, $weekday_abbrev, $weekday_initial, $withcomments, $wp, $wp_broken_themes, $wp_db_version, $wp_did_header, $wp_did_template_redirect, $wp_file_description, $wp_filter, $wp_importers, $wp_plugins, $wp_taxonomies, $wp_the_query, $wp_themes, $wp_object_cache, $wp_query, $wp_queries, $wp_rewrite, $wp_roles, $wp_similiesreplace, $wp_smiliessearch, $wp_version, $wpcommentspopupfile, $wpcommentsjavascript, $wpdb [IF YOU NEED TO ADD MORE];


Of course you will still get some error, search that part of the code and look for what global variable the function is calling, and put it in the end of the declaration. Such as $acf in my case.

Good to go!


Magento & WordPress further thought about integration

October 15, 2011 § Leave a comment

We got no problem here

I think Magento is one of the top e-commerece open source software in the neighborhood. And I always like to move WordPress to be his/her neighbor.

Although they are from different background and code base. Some always manage to getting them to work together, such as integrating Magento’s Code into WordPress one.

Perfect Integration so far, only if you use wordpress for limted usage , such as blogging in e-commerce site.

It’s hard for a client

EI normally provide e-commerce site with full CMS suport, but when it comes to complicated html structured page, it becomes a headache for letting client to edit.

Think about all the CSS, DIVS, Class , ID, do you really want your client to touch that? I dont think it is a good idea.

Let Magento handle Shop stuff, WordPress got your static pages

How do we do that since you cannot put two system into one folder? I manage to make it work in htaccess method.

Step 1. Create a page in WordPress

Step 2. Create a rewrite rule for that particular page in Magento’s htaccess.

Step 3. View it now!

Good Stuff

1. As we know wordpress can be a powerful CMS with it’s clean workflow, Custom Post Type, Custom fields you name it.


1. Potentially affect the SEO searching?

2. Need to create rewrite rule whenever there is changes in pages (Will find a way to accomplish that, maybe making use of magento URL rewrite, a new plugin to WordPress I guess)

3. Two access point both in magento & wordpress, e.g. /about-us and /wordpress/about-us

Where Am I?

You are currently browsing entries tagged with wordpress at Nick Wan L.K..