<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP Engineer &#187; Integration</title>
	<atom:link href="http://wpengineer.com/tag/integration/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Mon, 21 May 2012 22:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use Constants To Integrate WordPress In Other CMS</title>
		<link>http://wpengineer.com/647/use-constants-integrate-wordpress/</link>
		<comments>http://wpengineer.com/647/use-constants-integrate-wordpress/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 13:03:18 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Constants]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=647</guid>
		<description><![CDATA[Sometimes you need to integrate WordPress into another CMS, like Typo3, Drupal or whatever is out there. The blog should have the same design, use same images and Javascript or implement existing links. Mostly you run the WordPress blog on a subdomain like blog.example.com and the data lies on example.com/css/ and so on. The easiest [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to integrate WordPress into another CMS, like Typo3, Drupal or whatever is out there. The blog should have the same design, use same images  and Javascript or implement existing links. Mostly you run the WordPress blog on a subdomain like blog.example.com and the data lies on example.com/css/ and so on.<br />
<span id="more-647"></span><br />
The easiest solution in such cases is to use constants, to access the existing files. We define them in functions.php of the theme folder:</p>
<pre lang="php">
&lt;?php
define(&#039;DIR_ROOT&#039;, &#039;http://example.com&#039;);
define(&#039;DIR_STYLESHEETS&#039;, DIR_ROOT . &#039;/css&#039;);
define(&#039;DIR_IMAGES&#039;, DIR_ROOT . &#039;/images&#039;);
define(&#039;DIR_JAVASCRIPT&#039;, DIR_ROOT . &#039;/js&#039;);
?&gt;
</pre>
<p>In your theme you use the constants like this:</p>
<pre lang="php">
&lt;script src=&quot;&lt;?php echo DIR_JAVASCRIPT; ?&gt;/myeffects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;img src=&quot;&lt;?php echo DIR_IMAGES; ?&gt;/myimage.jpg&quot; alt=&quot;foo&quot; /&gt;
</pre>
<p>Easy, right? Mostly a little stylesheet is enough for special WordPress adjustments, which you load after the stylesheets of the CMS.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/647/use-constants-integrate-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

