<?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>jesal gadhia &#187; wordpress</title>
	<atom:link href="http://jesal.us/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://jesal.us</link>
	<description></description>
	<lastBuildDate>Thu, 14 Jul 2011 18:51:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Integrating CodeIgniter with WordPress</title>
		<link>http://jesal.us/2010/12/integrating-codeigniter-with-wordpress/</link>
		<comments>http://jesal.us/2010/12/integrating-codeigniter-with-wordpress/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 20:13:58 +0000</pubDate>
		<dc:creator>J</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://jesal.us/?p=242</guid>
		<description><![CDATA[Recently I was working on a website for a small business client. They wanted a simple system to allow them to easily update a section of their website. Since it was a small website, I wanted to accomplish this without putting too much time but still creating something user-friendly and easy to use that can [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a website for a small business client. They wanted a simple system to allow them to easily update a section of their website. Since it was a small website, I wanted to accomplish this without putting too much time but still creating something user-friendly and easy to use that can get the job done. The main site was made using CodeIgniter. So we decided to create a WordPress blog for the client where they could put their content and I would pull that content inside their CI website. Here&#8217;s how:</p>
<p>First of all, install WordPress in a folder called blog in your website. It would be located at the top level directory of the website. So it would be alongside the system folder of the CI installation. If you already have a DB for your site, have WordPress add tables to that same DB with a prefix to make things simple (although this is not a requirement).</p>
<p>Once that&#8217;s done. All you have to do is add the following line in the at the top of your CodeIgniter&#8217;s index.php file. Change the path to wp-blog-header.php as needed to point to your wordpress&#8217;s root directory.</p>
<pre>
&lt;?php
require('blog/wp-blog-header.php');
</pre>
<p>One you get that dialed in, rest is pretty straight forward. All of WordPress&#8217; native API functions should now be accessible to you. So you could throw in a WordPress loop in any of the CI views like for example:</p>
<p><b>Articles.php (View):</b></p>
<pre>
&lt;?php
if ($type == 'Tag') { query_posts('tag='.$id.'&#038;posts_per_page=-1'); }
else if ($type == 'Category') { query_posts('category_name='.$id.'&#038;posts_per_page=-1'); }
else { query_posts('posts_per_page=-1'); }
while (have_posts()) : the_post(); // Loop
?&gt;
	&lt;a href="&lt;?=base_url();?&gt;Research/Article/&lt;?php the_ID(); ?&gt;"&gt;&lt;h4&gt;&lt;?php the_title(); ?&gt;&lt;/h4&gt;&lt;/a&gt;
	By &lt;?php the_author(); ?&gt;
	&lt;p class="details"&gt;&lt;? the_time('F jS, Y') ?&gt;&lt;/p&gt;
	&lt;?php the_excerpt(); ?&gt;
	&lt;hr/&gt;
&lt;?php
	endwhile; // End Loop
?&gt;
</pre>
<p>&#8230;and a sidebar on the same which which would list out all the tags and categories to select from:</p>
<pre>
&lt;!-- SIDE BAR --&gt;
&lt;div id="sideBar"&gt;
	&lt;h3&gt;Categories:&lt;/h3&gt;
	&lt;?php
	$args = array(
	'show_option_all'    =&gt; '',
	'orderby'            =&gt; 'name',
	'order'              =&gt; 'ASC',
	'show_last_update'   =&gt; '0',
	'style'              =&gt; 'none',
	'show_count'         =&gt; '0',
	'hide_empty'         =&gt; '1',
	'use_desc_for_title' =&gt; '1',
	'child_of'           =&gt; '0',
	'feed'               =&gt; '',
	'feed_type'          =&gt; '',
	'feed_image'         =&gt; '',
	'exclude'            =&gt; '',
	'exclude_tree'       =&gt; '',
	'include'            =&gt; '',
	'current_category'   =&gt; '0',
	'hierarchical'       =&gt; 'true',
	'title_li'           =&gt; __( 'Categories' ),
	'number'             =&gt; NULL,
	'echo'               =&gt; '1',
	'depth'              =&gt; '0');
	wp_list_categories( $args ); ?&gt;
	&lt;br&gt;

	&lt;h3&gt;Tags:&lt;/h3&gt;
	&lt;?php
	$args = array(
	'smallest'  =&gt; '12',
	'largest'   =&gt; '12',
	'unit'      =&gt; 'px',
	'number'    =&gt; '45',
	'format'    =&gt; 'flat',
	'separator' =&gt; ' ',
	'orderby'   =&gt; 'name',
	'order'     =&gt; 'ASC',
	'exclude'   =&gt; '',
	'include'   =&gt; '',
	'link'      =&gt; 'custom',
	'taxonomy'  =&gt; 'post_tag',
	'echo'      =&gt; true,
	'link_url'  =&gt; base_url()."Research/Articles/Tag/");
	wp_tag_cloud( $args ); ?&gt;

&lt;/div&gt;
&lt;!-- /SIDE BAR --&gt;
</pre>
<p><b>Article.php (View):</b></p>
<pre>
&lt;!-- CONTENT --&gt;
&lt;div id="mainContent"&gt;

    &lt;!-- LEFT NAV --&gt;
    &lt;div id="leftNav"&gt;
        &lt;a href="&lt;?=base_url();?&gt;Research/Articles" class="selected"&gt;Articles&lt;/a&gt;
    &lt;/div&gt;
    &lt;!-- /LEFT NAV --&gt;

    &lt;!-- MAIN COL --&gt;
    &lt;div id="mainColWide"&gt;
        &lt;h1&gt;&lt;?= $post-&gt;post_title ?&gt;&lt;/h1&gt;
        &lt;p class="details"&gt;&lt;?= the_time('F j, Y') ?&gt;&lt;/p&gt;
        &lt;?= wpautop($post-&gt;post_content) ?&gt;
        &lt;br/&gt;&lt;br/&gt;
        &lt;a href="&lt;?=base_url();?&gt;Research/Articles"&gt;back&lt;/a&gt;
    &lt;/div&gt;
    &lt;!-- /MAIN COL --&gt;
    &lt;br class="clearFloat" /&gt;
&lt;/div&gt;
&lt;!-- /CONTENT --&gt;
</pre>
<p><b>Research.php (Controller):</b></p>
<pre>
&lt;?php

class Research extends Base_Controller {

	function Research()
	{
        parent::Base_Controller();
	}

	function Index()
	{
        $this-&gt;data['content'] = $this-&gt;load-&gt;view('Research/index.php', $this-&gt;data, true);
        $this-&gt;load-&gt;view('layouts/master' ,$this-&gt;data);
	}

    function Articles($type = '', $id = '')
	{
        $this-&gt;data['type'] = $type;
        $this-&gt;data['id'] = $id;
        $this-&gt;data['content'] = $this-&gt;load-&gt;view('Research/articles.php', $this-&gt;data, true);
        $this-&gt;load-&gt;view('layouts/master' ,$this-&gt;data);
	}

    function Article($id)
	{
        $this-&gt;data['post'] = get_post($id);
        $this-&gt;data['id'] = $id;
        $this-&gt;data['content'] = $this-&gt;load-&gt;view('Research/article.php', $this-&gt;data, true);
        $this-&gt;load-&gt;view('layouts/master' ,$this-&gt;data);
	}
}
</pre>
<p>That&#8217;s it! This would allow us to browse all the blog entries without leaving the CI site. Other helper functions can also be found in WordPress&#8217;s documentation which can assist you in integrating the design.</p>
]]></content:encoded>
			<wfw:commentRss>http://jesal.us/2010/12/integrating-codeigniter-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Setup Pretty Premalinks for WordPress on IIS7</title>
		<link>http://jesal.us/2009/06/pretty-premalinks-for-wordpress-on-iis7/</link>
		<comments>http://jesal.us/2009/06/pretty-premalinks-for-wordpress-on-iis7/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 02:58:36 +0000</pubDate>
		<dc:creator>J</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://jesal.us/blog/?p=152</guid>
		<description><![CDATA[If you&#8217;re running WordPress on IIS7 like this blog and if you want clean URLs without the &#8220;index.php&#8221; you can do the following. Although before you get started you need to make sure you have FastCGI and URL Rewrite Module installed on your IIS7. If you&#8217;re missing one of those things, you can check out [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running WordPress on IIS7 like this blog and if you want clean URLs without the &#8220;index.php&#8221; you can do the following. </p>
<p>Although before you get started you need to make sure you have FastCGI and URL Rewrite Module installed on your IIS7.</p>
<p>If you&#8217;re missing one of those things, you can check out these guides:</p>
<p>- <a href="http://learn.iis.net/page.aspx/460/using-url-rewrite-module/" target="_blank">Using URL Rewrite Module</a><br />
- <a href="http://learn.iis.net/page.aspx/375/setting-up-fastcgi-for-php/" target="_blank">Setting up FastCGI for PHP</a></p>
<p>Once you&#8217;ve done that, go to the &#8220;Settings&#8221; section in your WordPress admin area and click on &#8220;Premalinks&#8221;:</p>
<p><img src="http://jesal.us/wp-content/uploads/premalinks-1024x524.jpg" alt="premalinks" title="premalinks"/></p>
<p>On that page, choose the &#8220;Custom, specify below&#8221; option and enter<br />
&#8220;/%year%/%monthnum%/%postname%/&#8221; (or any other format of your choosing) in the &#8220;Custom structure&#8221; text box.</p>
<p>After you save the settings, you&#8217;ll notice that all your blog posts will have their URLs in the format you specified earlier. Although if you try to click on one of them you&#8217;ll get a 404 &#8211; File Not Found error. Thats because we still haven&#8217;t told the server where to go when it gets those requests. </p>
<p>To do so, you&#8217;ll have to create a Web.Config file (if you don&#8217;t have one already) in the same directory as your WordPress blog. Once you&#8217;ve done that, paste the following inside configuration->system.webServer element:</p>
<pre>
&lt;rewrite&gt;
    &lt;rules&gt;
        &lt;rule name="Main Rule" stopProcessing="true"&gt;
            &lt;match url=".*" /&gt;
            &lt;conditions logicalGrouping="MatchAll"&gt;
                &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
                &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
            &lt;/conditions&gt;
            &lt;action type="Rewrite" url="index.php" /&gt;
        &lt;/rule&gt;
    &lt;/rules&gt;
&lt;/rewrite&gt;
</pre>
<p><a href="http://jesal.us/wp-content/uploads/web.config.txt" target="_blank">Click here</a> to download the entire Web.Config file.</p>
<p>That rewrite rule we added above will match any requested URL and if that URL does not corresponds to a file or a folder on a file system, then it will rewrite the URL to Index.php. At that point, WordPress will determine which content to serve based on the REQUEST_URI server variable that contains the original URL before it was modified by the rule.</p>
<p>After you&#8217;ve saved the Web.config file, fire up any one of the permalinks in your WordPress blog. If everything went as expected, you&#8217;ll see the correct content returned by the web server for every permalink.</p>
]]></content:encoded>
			<wfw:commentRss>http://jesal.us/2009/06/pretty-premalinks-for-wordpress-on-iis7/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

