<?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>scriptygoddess &#187; WordPress: Lessons Learned</title>
	<atom:link href="http://www.scriptygoddess.com/archives/category/wordpress/wordpress-lessons-learned/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Aug 2010 13:58:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>New WordPress 3.0 Navigation Menus &#8211; What you need to know to get started</title>
		<link>http://www.scriptygoddess.com/archives/2010/06/23/new-wordpress-3-0-navigation-menus-what-you-need-to-know-to-get-started/</link>
		<comments>http://www.scriptygoddess.com/archives/2010/06/23/new-wordpress-3-0-navigation-menus-what-you-need-to-know-to-get-started/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 21:40:08 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1640</guid>
		<description><![CDATA[One feature I&#039;m extremely excited to see in WordPress 3.0 is the new &#034;Menus&#034; feature. It&#039;s pretty easy to add and use in your theme. I was having trouble finding documentation on it, so this is not &#034;official&#034; but this is as far as I can tell, how you can go about using it. First, [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>One feature I&#039;m extremely excited to see in WordPress 3.0 is the new &#034;Menus&#034; feature. It&#039;s pretty easy to add and use in your theme. I was having trouble finding documentation on it, so this is not &#034;official&#034; but this is as far as I can tell, how you can go about using it.</p>
<p>First, if your theme doesn&#039;t already have a functions.php file, go ahead and create one. Then add the following PHP code:</p>
<p><code>register_nav_menus( array(<br />
		'mainnav' => 'Main Nav'<br />
	) );</code></p>
<p>&#034;mainnav&#034; (which is the menu&#039;s &#034;slug&#034; and shown as &#034;Main Nav&#034; in the admin) is just what I came up with &#8211; but you can name it whatever you want, and you can have multiple nav menus if you want. Just register them all in that functions file. Here&#039;s an example with 3 nav menus:</p>
<p><code>register_nav_menus( array(<br />
		'mainnav' => 'Main Nav',<br />
		'navtwo' => 'Nav Bar Two',<br />
'navthree' => 'Nav Bar Three',<br />
	) );</code></p>
<p>That&#039;s it &#8211; What that does is tell your theme you&#039;re going to have three different/unique menus. You can use them as many times as you want, wherever you want in your theme.</p>
<p>You&#039;ll create your menus in the WordPress admin &#8211; this is pretty self explanatory (<a href="http://codex.wordpress.org/Appearance_Menus_SubPanel">and described pretty well here</a>) &#8211; add pages, categories, custom links that point outside your blog, whatever you want. Give the menu a name and &#034;apply&#034; it to a location:</p>
<p><img src="http://www.scriptygoddess.com/wp-content/uploads/2010/06/Screen-shot-2010-06-23-at-Jun-23-3.27.27-PM.png" alt="" title="Screen shot 2010-06-23 at Jun 23  3.27.27 PM" width="296" height="309" class="aligncenter size-full wp-image-1641" /></p>
<p>Now &#8211; to add it to your theme&#8230; You get a whole bunch of options so if you need the menu to display one way in one location, and a different way in another location &#8211; you can do that! </p>
<p>Here&#039;s a simple example where I&#039;ve stripped out the nav &#034;wrapper&#034; and any automatic styling it would add &#8211; just drop this in your theme file where you want the menu to show up (like your header.php, or footer.php&#8230; wherever)</p>
<p><code>$args =  array( 'menu' => 'mainnav', 'container' => false, 'menu_id' => false, 'menu_class' => false);<br />
wp_nav_menu($args);</code></p>
<p>But you can insert an ID or a class. <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">This is detailed pretty well here.</a></p>
<p>I&#039;ve already started to use this and it&#039;s great. Clients have been really happy that they can now manage their own menus without requiring edits to a template.</p>
<p><strong>Updated to add:</strong> As pointed out by Stephen in the comments &#8211; if you are creating themes for general public use and you&#039;re not sure what version of WordPress your userbase will be running &#8211; you will want to wrap these new functions in a &#034;<em>if (function_exists(&#039;new-fancy-function-name-here&#039;)) { &#8230; }</em>&#034;. <a href="http://www.scratch99.com/2010/06/practical-theme-support-for-wordpress-3-0-menus/">He has details on this on his site here.</a> In there, he linked to another article that would have helped me out a lot had Google liked the page more so I could have found it when I was working on this recently &#8211; but there&#039;s some <a href="http://justintadlock.com/archives/2010/06/01/goodbye-headaches-hello-menus">additional reading here on how to set all this up</a> (it&#039;s a lot more in depth than I got into &#8211; I guess my version is the &#034;Cliff Notes&#034;) <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2010/06/23/new-wordpress-3-0-navigation-menus-what-you-need-to-know-to-get-started/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Blogger to WordPress move from hell!</title>
		<link>http://www.scriptygoddess.com/archives/2010/05/21/the-blogger-to-wordpress-move-from-hell/</link>
		<comments>http://www.scriptygoddess.com/archives/2010/05/21/the-blogger-to-wordpress-move-from-hell/#comments</comments>
		<pubDate>Sat, 22 May 2010 03:08:13 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1638</guid>
		<description><![CDATA[One of the projects I&#039;ve been working on recently is to move a client&#039;s Blogger blog into WordPress. The blog is a few years old, but it has an ENORMOUS amount of comments. Doing the standard import from within WordPress wasn&#039;t bringing over all the posts and it barely scratched the surface of bringing over [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2010/03/14/custom-template-for-parent-and-sub-categories-without-a-plugin-in-wordpress/' rel='bookmark' title='Permanent Link: Custom Template for Parent and Sub Categories (without a plugin) in WordPress'>Custom Template for Parent and Sub Categories (without a plugin) in WordPress</a> <small>When using WordPress as a CMS, I often repurpose the...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>One of the projects I&#039;ve been working on recently is to move a client&#039;s Blogger blog into WordPress. The blog is a few years old, but it has an ENORMOUS amount of comments. Doing the standard import from within WordPress wasn&#039;t bringing over all the posts and it barely scratched the surface of bringing over the comments.</p>
<p>I found <a href="http://artlung.com/blog/2010/03/02/migrating-an-old-blogger-blog-to-wordpress/">this post on ArtLung: Migrating an old Blogger Blog To WordPress</a> &#8211; which was a HUGE help. The gist of that was you need to download an export file from Blogger, then <a href="http://code.google.com/p/google-blog-converters-appengine/downloads/list">get this script</a> you run from the terminal (on Mac) which will convert the Blogger xml into a xml that WordPress will understand. (Just to give you an idea what we&#039;re talking about &#8211; the Blogger XML file I downloaded was over 40MB.)</p>
<p>THEN the fun began. After the conversion to WordPress XML &#8211; the file was still about 30MB. This meant that I had to run the import over a dozen times before it could chew through the whole file. When the import times out and you run it again, it recognizes that some posts are already there, so it doesn&#039;t import them a second time &#8211; but for some reason, it seemed to have trouble with a bunch of comments. <em>Some</em> of the comments DID get imported more than once. As well &#8211; the comment counts for each post weren&#039;t getting updated. SO! Here&#039;s the fix I pieced together for those issues.</p>
<p>First, to remove the duplicate comments &#8211; in PHPMyAdmin &#8211; I ran the following SQL command: (*DISCLAIMER: make sure you backup your database before attempting any of this!!)</p>
<p><code>CREATE TABLE temp_table AS SELECT * FROM wp_comments WHERE 1 GROUP BY `comment_post_ID`,`comment_content`,`comment_date`;</code></p>
<p>What that does is create a duplicate of the wp_comments table &#8211; but it&#039;s only grabbing the unique entries. If a comment is posted to the same post, has the same content and the same date &#8211; we&#039;ll just be grabbing one of those and ignoring the rest.</p>
<p><strong>UPDATED TO ADD:</strong> One important thing I need to add in here is that you need to set the primary keys and a few indexes for this new table &#8211; This is the structure of a normal wp_comments table:</p>
<p><code>CREATE TABLE `wp_comments` (<br />
  `comment_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,<br />
  `comment_post_ID` bigint(20) unsigned NOT NULL DEFAULT '0',<br />
  `comment_author` tinytext NOT NULL,<br />
  `comment_author_email` varchar(100) NOT NULL DEFAULT '',<br />
  `comment_author_url` varchar(200) NOT NULL DEFAULT '',<br />
  `comment_author_IP` varchar(100) NOT NULL DEFAULT '',<br />
  `comment_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',<br />
  `comment_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',<br />
  `comment_content` text NOT NULL,<br />
  `comment_karma` int(11) NOT NULL DEFAULT '0',<br />
  `comment_approved` varchar(20) NOT NULL DEFAULT '1',<br />
  `comment_agent` varchar(255) NOT NULL DEFAULT '',<br />
  `comment_type` varchar(20) NOT NULL DEFAULT '',<br />
  `comment_parent` bigint(20) unsigned NOT NULL DEFAULT '0',<br />
  `user_id` bigint(20) unsigned NOT NULL DEFAULT '0',<br />
  PRIMARY KEY (`comment_ID`),<br />
  KEY `comment_approved` (`comment_approved`),<br />
  KEY `comment_post_ID` (`comment_post_ID`),<br />
  KEY `comment_approved_date_gmt` (`comment_approved`,`comment_date_gmt`),<br />
  KEY `comment_date_gmt` (`comment_date_gmt`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;</code></p>
<p>THEN, I ran this SQL command;</p>
<p><code>DROP TABLE wp_comments;<br />
RENAME TABLE temp_table TO wp_comments;</code></p>
<p>What that does is delete the wp_comments table, then we rename our new and improved &#034;temp_table&#034; so that it is now the official wp_comments table.</p>
<p>NEXT &#8211; we want to update the comment counts. To save having to recount the comments each time &#8211; there is a field in the wp_posts table that stores the total number of comments. However, with the way this import worked, those numbers did not get updated so most were saying there were 0 comments on posts that did have comments. To fix that issue I ran the following SQL command: (which I found <a href="http://planet.mysql.com/entry/?id=23970">here on Planet MySQL</a>)</p>
<p><code>UPDATE wp_posts wpp<br />
LEFT JOIN<br />
(SELECT comment_post_id AS c_post_id, count(*) AS cnt FROM wp_comments<br />
 WHERE comment_approved = 1 GROUP BY comment_post_id) wpc<br />
ON wpp.id=wpc.c_post_id<br />
SET wpp.comment_count=wpc.cnt<br />
WHERE wpp.post_type IN ('post', 'page')<br />
AND (wpp.comment_count!=wpc.cnt OR (wpp.comment_count != 0 AND wpc.cnt IS NULL));</code></p>
<p>Which as far as I can tell gets the comment counts for each post in wp_posts. (I can&#039;t tell you more than that because once you start getting into the &#034;LEFT JOIN&#034; stuff in sql, my brain shuts off)</p>
<p>The other piece advice I&#039;ll give is if you have a ginormous blog that you have to move like the one I was working with &#8211; set the blog up locally using <a href="http://www.mamp.info/en/index.html">MAMP</a>, do the imports, all the database correcting stuff &#8211; then just export the database and import it onto your server. The database file ended up only being 14MB uncompressed &#8211; way better than trying to chew through a 30MB import file. Once the database is up on your server, <a href="http://www.scriptygoddess.com/archives/2008/06/14/moving-a-wordpress-install/">a few more SQL commands (just like if you&#039;re moving your blog to a new domain)</a> to change the local version (probably http://localhost:8888 ) to your actual domain name, and you&#039;re done!</p>
<p><strong>Another tidbit to add:</strong> if you need to redirect blogger formatted url (that may include &#034;.html&#034; in the end) &#8211; add this to your htaccess file and it should redirect to the new (non extension ending) URL:</p>
<p><code>RewriteEngine On<br />
RewriteRule (.*)\.html $1 [R=301,L] </code></p>
<p>(I tooke off the first line and put the second line under the &#034;RewriteEngine On&#034; that WordPress has in it&#039;s htaccess block and it worked great)</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2010/03/14/custom-template-for-parent-and-sub-categories-without-a-plugin-in-wordpress/' rel='bookmark' title='Permanent Link: Custom Template for Parent and Sub Categories (without a plugin) in WordPress'>Custom Template for Parent and Sub Categories (without a plugin) in WordPress</a> <small>When using WordPress as a CMS, I often repurpose the...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2010/05/21/the-blogger-to-wordpress-move-from-hell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</title>
		<link>http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 18:10:21 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1622</guid>
		<description><![CDATA[Background: For a site I was working on, I was pulling in content from another page onto the homepage. However I wanted to just bring in an excerpt not the whole page. (And actually, a customized excerpt at that &#8211; not a default set character or word limit). I also didn&#039;t want any images brought [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/19/two-block-of-content-for-pages/' rel='bookmark' title='Permanent Link: Two Blocks of Content for Pages in WordPress'>Two Blocks of Content for Pages in WordPress</a> <small>I just saw this plugin show up on the WordPress...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Background: For a site I was working on, I was pulling in content from another page onto the homepage. However I wanted to just bring in an excerpt not the whole page. (And actually, a customized excerpt at that &#8211; not a default set character or word limit). I also didn&#039;t want any images brought in &#8211; I just wanted the text and any associated formatting.</p>
<p>Well, one problem here is that WordPress pages (at least as of this writing &#8211; with WordPress in version 2.8.5) do not have excerpts for pages. Only for posts. The way around this is to use the &lt;!&#45;&#45; more &#45;&#45;&gt; tag where you want your break. So that works fine &#8211; but what about stripping out the images? I&#039;m still working on my reg-ex knowledge, but I found this one from <a href="http://www.webmasterworld.com/forum88/6851.htm">here</a> and it worked for me. So this is what I&#039;m doing when I&#039;m pulling in my page excerpt:</p>
<p><code>&lt;?php<br />
$posts = query_posts('page_id=1234');<br />
if (have_posts()) : while (have_posts()) : the_post();<br />
//this makes the more work...<br />
global $more; $more = 0;<br />
?&gt;<br />
&lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;<br />
&lt;?php<br />
$content = get_the_content('');<br />
$content = preg_replace('/&lt;img[^&gt;]+&gt;/is', '', $content);<br />
echo $content;<br />
?&gt;<br />
&lt;p&gt;&lt;a href="&lt;?php the_permalink(1234); ?&gt;"&gt;&lt;img src="/images/more.gif" /&gt;&lt;/a&gt;&lt;/p&gt;<br />
&lt;?php endwhile; endif; ?&gt;</code></p>
<p>*we&#039;re assuming &#034;1234&#034; is the ID of my page in the example above&#8230;</p>
<p>You&#039;ll also notice I manually added my &#034;more&#034; button image&#8230;</p>
<p>To read more about the more tag (and see where I got that global $more; $more = 0; from, you can see the <a href="http://codex.wordpress.org/Customizing_the_Read_More">WordPress codex here on the subject</a>. (Scroll to the very bottom of the page &#8211; to the section title &#034;How to use Read More in Pages&#034;)</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/19/two-block-of-content-for-pages/' rel='bookmark' title='Permanent Link: Two Blocks of Content for Pages in WordPress'>Two Blocks of Content for Pages in WordPress</a> <small>I just saw this plugin show up on the WordPress...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adding a block of HTML to a WordPress post</title>
		<link>http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 03:10:10 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1617</guid>
		<description><![CDATA[One problem with the WYSIWYG editor in WordPress is that if you are trying to manually add in a block of HTML, the editor may try to translate that block into paragraph format, inserting &#60;p&#62; tags where you didn&#039;t intend, possibly (and most likely) ruining what you were intending to do with your HTML code [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>One problem with the WYSIWYG editor in WordPress is that if you are trying to manually add in a block of HTML, the editor may try to translate that block into paragraph format, inserting &lt;p&gt; tags where you didn&#039;t intend, possibly (and most likely) ruining what you were intending to do with your HTML code block.</p>
<p>Previously, my way around this had included the use of various plugins that had you wrap certain areas in your post with specific comments that would tell WordPress to leave that block alone and not insert those paragraph tags. There was still some issues doing it this way &#8211; as it required you to view these posts in the HTML view. Viewing them in the visual editor would mess everything up.</p>
<p>So, keeping in line with what seems to be a current trend at the moment of solving all my problems with shortcodes, that&#039;s how I&#039;ve decided to solve this problem as of late.</p>
<p>First &#8211; (you&#039;ll only need to do this once) &#8211; add the PHP code so that you can do the shortcode. If you don&#039;t already have a functions.php file in your theme directory, create one and add the following code:</p>
<p><code>function scriptysAddHTML_func($atts) {<br />
global $post;<br />
$id = $atts['id'];<br />
if (empty($id)) return;<br />
return get_post_meta($post->ID, $id, true);<br />
}<br />
add_shortcode('html', 'scriptysAddHTML_func');</code></p>
<p>Then, in your post when you want to add some custom HTML, paste your block of HTML into the <strong>value</strong> of a new custom field. For the <strong>name</strong> of this custom field, give it a unique name with no spaces. (For example: My_HTML_Block)</p>
<p>In your WordPress post, where you want this block to appear, add the shortcode like this:</p>
<p><code>&#91;html id=My_HTML_Block]</code></p>
<p>You would add it exactly like the above, except instead of My_HTML_Block, you would change that to be the name you gave your custom field.</p>
<p><strong>Extra Tip</strong> If for some reason, you&#039;re using more than one shortcode in your post and it doesn&#039;t seem like they&#039;re working&#8230; if you&#039;re using them one right after the other, make sure there is a space between them. ie. If you&#039;re using my <a href="http://www.scriptygoddess.com/archives/2009/08/29/simple-shortcode-for-line-breaks/">linebreak shortcode</a>, and you were adding more than one linebreak&#8230; it might not work if you do this:</p>
<p><code>[br][br][br]</code></p>
<p>You my have to do this:</p>
<p><code>[br] [br] [br]</code></p>
<p>Little minor thing, but something you might not have thought of&#8230; figured I&#039;d mention it. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search from WordPress Admin (Post Listing) Redirecting to Home Page</title>
		<link>http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 14:14:52 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1616</guid>
		<description><![CDATA[This is possibly the most bizarre thing I&#039;ve ever seen. (This is relevant to version 2.8.4). If you have your WordPress install set up to be http://www.yourdomain.com but your blog install set up to be http://yourdomain.com (note the missing &#034;www&#034;) and you try to search for posts from with the WordPress admin, you get redirected [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is possibly the most bizarre thing I&#039;ve ever seen. (This is relevant to version 2.8.4). If you have your WordPress install set up to be <strong>http://www.yourdomain.com</strong> but your blog install set up to be <strong>http://yourdomain.com</strong> (note the missing &#034;www&#034;) and you try to search for posts from with the WordPress admin, you get redirected to your blog&#039;s (front end) homepage. If you change your WordPress install to match your blog install (ie. remove the WWW &#8211; then it works fine) Sounds like a bug to me. I&#039;ll submit it to the WP team and see what they say &#8211; but in the meantime should you be up past 1am trying to figure that little gem out, hopefully I&#039;ve saved you some trouble and you can get to sleep earlier than I did. LOL!</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 Issues</title>
		<link>http://www.scriptygoddess.com/archives/2009/06/17/wordpress-2-8-issues/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/06/17/wordpress-2-8-issues/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 17:20:12 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2009/06/17/wordpress-2-8-issues/</guid>
		<description><![CDATA[In case you hadn&#039;t heard (and if you&#039;re using wordpress, how could you NOT have heard) WordPress 2.8 is out. One of the features included in this round was a rework of the way Widgets work &#8211; including a easier to use API. In light of this, I made use of the new API (armed [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2010/05/21/the-blogger-to-wordpress-move-from-hell/' rel='bookmark' title='Permanent Link: The Blogger to WordPress move from hell!'>The Blogger to WordPress move from hell!</a> <small>One of the projects I&#039;ve been working on recently is...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In case you hadn&#039;t heard (and if you&#039;re using wordpress, how could you NOT have heard) <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  WordPress 2.8 is out. One of the features included in this round was a rework of the way Widgets work &#8211; including a easier to use API. In light of this, I made use of the new API (<a href="http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28">armed with this great tutorial and sample file</a>) and created some custom widgets for my clients.</p>
<p>A few problems:<br />
I needed to use TinyMCE for one of the textareas, (<a href="http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/">There&#039;s some good information here on how to do that</a>) because the client doesn&#039;t know and doesn&#039;t want to know HTML. Trying to apply TinyMCE to the textarea in a widget presented all kind of problems.</p>
<p>Also &#8211; just simply dragging and dropping the widgets onto the correct sidebar was excruciating slow.</p>
<p>The solution to both of these problems was solved in the <a href="http://wordpress.org/support/topic/279132">2.8 FAQ</a> &#8211; specifically &#8211; turning on &#034;Accessibility Mode&#034; in the screen options for the widgets page. It&#039;s not as snazzy as it was before &#8211; but being excruciatingly slow and TinyMCE not working isn&#039;t snazzy either. So I&#039;ll take &#034;functional&#034; over &#034;Snazzy but not functional&#034;.</p>
<p>Anyway &#8211; just putting this out there for anyone else running into similar problems.</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2010/05/21/the-blogger-to-wordpress-move-from-hell/' rel='bookmark' title='Permanent Link: The Blogger to WordPress move from hell!'>The Blogger to WordPress move from hell!</a> <small>One of the projects I&#039;ve been working on recently is...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/06/17/wordpress-2-8-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>open_basedir restriction in effect error on WordPress page</title>
		<link>http://www.scriptygoddess.com/archives/2009/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:40:39 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1609</guid>
		<description><![CDATA[This is the second time I&#039;ve run into this problem. I opted not to post about it the first time, because the solution was so simple it was kind of silly. But lo-and-behold &#8211; I hit it again and forgot what the solution was anyway. I know there can be more than one thing that [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is the second time I&#039;ve run into this problem. I opted not to post about it the first time, because the solution was so simple it was kind of silly. But lo-and-behold &#8211; I hit it again and forgot what the solution was anyway. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I know there can be more than one thing that causes that &#034;open_basedir restriction in effect&#034; error &#8211; but in my case it was because:</p>
<p>1) I was moving a wordpress site to another location (usually a subdomain of a live site so I could set it up as a &#034;test area&#034;)<br />
2) In the settings page, I had specified a different path for uploads (this is done on the &#034;miscellaneous&#034; settings page). This directory was actually OUTSIDE of the wordpress directory, which means I had to use the full server path to point to my custom uploads directory&#8230;</p>
<p>So I copied over the files to the test area, copied the database to the test database, changed the domain to the test domain using <a href="http://www.scriptygoddess.com/archives/2008/06/14/moving-a-wordpress-install/">this method</a>. But if you&#039;ve specified a path for uploads on that miscellaneous page &#8211; you&#039;ll need to log in once everything is all set up and change the path there too to the new one pointed at the new location.</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IMPORTANT &#8211; WARNING &#8211; BEFORE YOU UPGRADE WORDPRESS</title>
		<link>http://www.scriptygoddess.com/archives/2009/02/12/important-warning-before-you-upgrade-wordpress/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/02/12/important-warning-before-you-upgrade-wordpress/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 20:23:02 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1599</guid>
		<description><![CDATA[If you are using the default theme and have made modifications to it without renaming it - you may be in for a surprise when you upgrade using the new easy auto-upgrade button. Your theme will be replaced with the original one that WordPress came with. For all I know there&#039;s probably already a document/installation [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/30/multiple-featured-content-galleries/' rel='bookmark' title='Permanent Link: Multiple Featured Content Galleries'>Multiple Featured Content Galleries</a> <small>On a site I was working on recently, the client...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><strong>If you are using the default theme and have made modifications to it without renaming it </strong>- you may be in for a surprise when you upgrade using the new easy auto-upgrade button. Your theme will be replaced with the original one that WordPress came with. For all I know there&#039;s probably already a document/installation instruction that warns you of this fact somewhere. (I would hope anyway)</p>
<p>I know this may or may not apply to many people &#8211; but having just lost a bunch of changes on a site I was working on (had been tweaking the default theme to test out some stuff) I didn&#039;t realize that 1-click upgrade feature would do that.</p>
<p>Other than that &#8211; the new upgrade thing is awesome. Easily upgraded a bunch of other sites (that thankfully used custom named themes!) without issue and because it just a one-click upgrade &#8211; I did it much sooner than I would have if I had to download and manually upload everything.</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/30/multiple-featured-content-galleries/' rel='bookmark' title='Permanent Link: Multiple Featured Content Galleries'>Multiple Featured Content Galleries</a> <small>On a site I was working on recently, the client...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/02/12/important-warning-before-you-upgrade-wordpress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress: Make home page show latest post (in the &quot;single post&quot; format)</title>
		<link>http://www.scriptygoddess.com/archives/2007/04/28/wordpress-make-home-page-show-latest-post-in-the-single-post-format/</link>
		<comments>http://www.scriptygoddess.com/archives/2007/04/28/wordpress-make-home-page-show-latest-post-in-the-single-post-format/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 07:05:09 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Bookmarks]]></category>
		<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/04/28/wordpress-make-home-page-show-latest-post-in-the-single-post-format/</guid>
		<description><![CDATA[In a custom wordpress theme design I was working on tonight, I was trying to do as the title describes &#8211; make the home page show only one post (yes I know there&#039;s already a built in way to do this) but I wanted it to show up the same way the single view shows [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In a custom wordpress theme design I was working on tonight, I was trying to do as the title describes &#8211; make the home page show only one post (yes I know there&#039;s already a built in way to do this) but I wanted it to show up the same way the single view shows it &#8211; with the comments expanded and the comments form visible, etc. If you know of another/better way to do this, please say so in the comments. But this DID do the trick. I found <a href="http://wordpress.org/support/topic/110676">this page</a> in the support archives. The idea was to create your index.php to look like you wanted (ie. exactly like the &#034;single.php&#034; page) but add this before you start the loop:</p>
<p><code>&lt;?php<br />
      $i=0; // Initialize to Zero;<br />
      if (have_posts()) :<br />
        while (have_posts()) : the_post();<br />
            if ($i==0) {$recentpostid = $post-&gt;ID; $i=$i+1;}<br />
        endwhile;<br />
      endif;<br />
      //get only the latest post<br />
      $posts = query_posts( 'p='.$recentpostid."'");<br />
?&gt;</code></p>
<p>and then you start your loop like you normally would&#8230;</p>
<p><code>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;</code></p>
<p>Worked for me!</p>
<p><strong>Update</strong> As Danny pointed out in the comments &#8211; there&#039;s a simpler way to do this. Put the following code on the page (I put it before the loop and it worked)<br />
<code>&lt;?php $wp_query-&gt;is_single = true; ?&gt;</code><br />
Much simpler <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/' rel='bookmark' title='Permanent Link: Search from WordPress Admin (Post Listing) Redirecting to Home Page'>Search from WordPress Admin (Post Listing) Redirecting to Home Page</a> <small>This is possibly the most bizarre thing I&#039;ve ever seen....</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/27/adding-a-block-of-html-to-a-wordpress-post/' rel='bookmark' title='Permanent Link: Adding a block of HTML to a WordPress post'>Adding a block of HTML to a WordPress post</a> <small>One problem with the WYSIWYG editor in WordPress is that...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2007/04/28/wordpress-make-home-page-show-latest-post-in-the-single-post-format/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Overcoming the upgrade</title>
		<link>http://www.scriptygoddess.com/archives/2006/12/22/overcoming-the-upgrade/</link>
		<comments>http://www.scriptygoddess.com/archives/2006/12/22/overcoming-the-upgrade/#comments</comments>
		<pubDate>Sat, 23 Dec 2006 06:25:22 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress: Lessons Learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2006/12/22/overcoming-the-upgrade/</guid>
		<description><![CDATA[I&#039;ll make notes of issues I ran into and the solutions as I go along, but so far I&#039;ve had two three issues come up when upgrading. 1) When I ran the upgrade, it sort of died before finishing&#8230; I refreshed and it told me it was all set. Checked on the main page, and [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/30/multiple-featured-content-galleries/' rel='bookmark' title='Permanent Link: Multiple Featured Content Galleries'>Multiple Featured Content Galleries</a> <small>On a site I was working on recently, the client...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#039;ll make notes of issues I ran into and the solutions as I go along, but so far I&#039;ve had <strike>two</strike> three issues come up when upgrading.</p>
<p>1) When I ran the upgrade, it sort of died before finishing&#8230; I refreshed and it told me it was all set. Checked on the main page, and everything seemed to be okay &#8211; but when I logged in to start tinkering around with the settings, I couldn&#039;t log in completely. I got the dashboard with no navigation and then I clicked on something and all it wanted to do was send me to the profile page &#8211; but with nothing showing except &#034;You do not have sufficient permissions to access this page&#034;. Googled for a solution and <a href="http://markjaquith.wordpress.com/2006/03/28/wordpress-error-you-do-not-have-sufficient-permissions-to-access-this-page/">found one on Mark&#039;s site</a>. Ran his script, and all was well again.</p>
<p>2) Then I discovered that clicking on the the &#034;previous entries&#034; link at the bottom sent me to a &#034;page can not be found&#034; error page. Google to the rescue &#8211; and <a href="http://codex.wordpress.org/Using_Permalinks">found one on the WordPress Codex</a>&#8230; (scroll ALLLL the way down to &#034;Paged Navigation doesn&#039;t work&#034; &#8211; There it will tell you that the error I was getting was due to the .htaccess file that WordPress generates. Delete the contents (or at least the wordpress stuff in there) and manually add the code back in from the Options -> Permalinks page. Again, all was well again.</p>
<p>3) This one was really weird. I had a post that was showing up in Firefox but not IE. It was like it didn&#039;t exist at all on IE. Wasn&#039;t in the source. Try to pull up the post page, and it gives you a 404 error not found. Turns out &#8211; and maybe this was because of the glitch during the upgrade &#8211; the post didn&#039;t have any status indicated. It wasn&#039;t marked as &#034;Published&#034;, &#034;Draft&#034;, or &#034;Private&#034;. (The weird thing is that, then WHY did Firefox show it at all?!?) Anyway, clicking the &#034;Published&#034; box and re-saving the post seemed to fix the problem.</p>
<p>If you find any other broken links or errors, etc. &#8211; please let me know!</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/30/multiple-featured-content-galleries/' rel='bookmark' title='Permanent Link: Multiple Featured Content Galleries'>Multiple Featured Content Galleries</a> <small>On a site I was working on recently, the client...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2006/12/22/overcoming-the-upgrade/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.933 seconds -->
