<?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</title>
	<atom:link href="http://www.scriptygoddess.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com</link>
	<description></description>
	<lastBuildDate>Wed, 13 Jan 2010 17:57:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Never Update the Copyright Year Again (on a PHP page)</title>
		<link>http://www.scriptygoddess.com/archives/2010/01/13/never-update-the-copyright-year-again-on-a-php-page/</link>
		<comments>http://www.scriptygoddess.com/archives/2010/01/13/never-update-the-copyright-year-again-on-a-php-page/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 17:57:55 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1628</guid>
		<description><![CDATA[This is a really silly little trick &#8211; but if you have a PHP page that has a &#169; copyright year at the bottom &#8211; there is no reason you should be updating that every year (unless it&#039;s just something you overlooked initially)   As you get requests from clients now that we&#039;re in [...]


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>
</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 a really silly little trick &#8211; but if you have a PHP page that has a &copy; copyright year at the bottom &#8211; there is no reason you should be updating that every year (unless it&#039;s just something you overlooked initially) <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  As you get requests from clients now that we&#039;re in a new year to change the copyright year in the footer &#8211; do yourself a favor and use this instead so you never have to do it again. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code>&lt;?php echo date("Y"); ?&gt;</code></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>
</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/01/13/never-update-the-copyright-year-again-on-a-php-page/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>swfobject &#8211; flash doesn&#039;t load in Firefox</title>
		<link>http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 18:17:43 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1627</guid>
		<description><![CDATA[Ran into a bizarre problem today using swfobject. A lot of wasted time, but I&#039;ll give you the short story / solution.
I&#039;m not sure of what other factors played a role (the fact that the element was in a absolute positioned container, or that the immediate container to the flash element was in a float) [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/03/23/multi-row-carousel-and-image-loader-with-jquery/' rel='bookmark' title='Permanent Link: Multi-Row Carousel and Image Loader with JQuery'>Multi-Row Carousel and Image Loader with JQuery</a> <small>A recent project I&#039;ve been working on involved a portfolio...</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>Ran into a bizarre problem today using <a href="http://code.google.com/p/swfobject/">swfobject</a>. A lot of wasted time, but I&#039;ll give you the short story / solution.</p>
<p>I&#039;m not sure of what other factors played a role (the fact that the element was in a absolute positioned container, or that the immediate container to the flash element was in a float) but I had the call to the swfobject javascript in the BODY tags of the html (not within the head tags). This was apparently causing Firefox to not display the flash. Simply moving the swfobject javascript code within the head tags of the html instantly fixed the problem.</p>
<p>I know I&#039;ve used swfobject inside the body before &#8211; so I&#039;m sure there&#039;s something else that contributed to the problem.</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/03/23/multi-row-carousel-and-image-loader-with-jquery/' rel='bookmark' title='Permanent Link: Multi-Row Carousel and Image Loader with JQuery'>Multi-Row Carousel and Image Loader with JQuery</a> <small>A recent project I&#039;ve been working on involved a portfolio...</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/12/16/swfobject-flash-doesnt-load-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple Featured Content Galleries</title>
		<link>http://www.scriptygoddess.com/archives/2009/10/30/multiple-featured-content-galleries/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/10/30/multiple-featured-content-galleries/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 17:44:40 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1623</guid>
		<description><![CDATA[On a site I was working on recently, the client was using the Featured Content Galleries plugin for their homepage (you can download it from here) &#8211; but they wanted to add a gallery like this to other pages on their website and have other featured content on those pages. This is not a feature [...]


Related posts:<ol><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>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/' rel='bookmark' title='Permanent Link: Delink Pages Plugin'>Delink Pages Plugin</a> <small>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin...</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>On a site I was working on recently, the client was using the <a href="http://www.featuredcontentgallery.com/">Featured Content Galleries</a> plugin for their homepage (<a href="http://wordpress.org/extend/plugins/featured-content-gallery/">you can download it from here</a>) &#8211; but they wanted to add a gallery like this to other pages on their website and have other featured content on those pages. This is not a feature currently supported &#034;out of the box&#034; with this plugin. But hacking it in is pretty easy.</p>
<p>First &#8211; you will need to create a category that you will use for the other Featured Content Galleries &#8211; one per page you want to use it with. Assign posts you want to appear in the featured content gallery with this new category. For example &#8211; lets say on your homepage you&#039;re running the featured content gallery, and it&#039;s showing posts from the &#034;featured-posts&#034; category. But lets say you have a &#034;products&#034; page and on that page, you only want articles related to your products showing up on that page. So you would need to create another category &#8211; lets call it &#034;featured-posts-about-products&#034;. Then assign this new category to your articles about products. (**Make a note of what the category ID is of this new category!)</p>
<p>You will still need to make sure those posts have a custom field with a key of &#034;articleimg&#034; and a value that is the full URL to the image you want in the featured content gallery.</p>
<p>Now we can start hacking at the plugin&#8230;</p>
<p>Open up <strong>gallery.php</strong> (found in the <strong>featured-content-gallery</strong> plugin directory). MAKE A BACKUP OF GALLERY.PHP JUST IN CASE! <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Then, look for this line:</p>
<pre class="brush: php;">query_posts('category_name=' . get_option('gallery-category') . '&amp;showposts=' . get_option('gallery-items'));</pre>
<p>and replace with the following:</p>
<pre class="brush: php;">$categoryToUse = 'category_name=' . get_option('gallery-category');
if (isset($catidforgallery) &amp;&amp; is_numeric($catidforgallery)) {
$categoryToUse = 'cat=' . $catidforgallery;
}
query_posts($categoryToUse . '&amp;showposts=' . get_option('gallery-items'));</pre>
<p>NOW in your theme &#8211; where you have the featured content gallery appearing &#8211; if you want it to pull from that special category, you can do this:</p>
<pre class="brush: php;">&lt;?php
$catidforgallery = 1234;
include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php');
?&gt;</pre>
<p>The above code assumes our category ID is &#034;1234&#034;.</p>
<p>But lets say you&#039;re using this template for a number of different pages, and on each one you want a different content gallery&#8230; Again, set up these new categories, make notes of what their IDs are &#8211; then on each page that&#039;s using this template, to specify what category ID the featured content gallery should use, add a custom field with a key of &#034;category-feature-rotator&#034; and a value of the category ID you want in the gallery.</p>
<p>Modify the theme/template code to this instead:</p>
<pre class="brush: php;">&lt;?php
$category_feature_rotator = get_post_meta($post-&gt;ID, &quot;category-feature-rotator&quot;, true);
$catidforgallery = false;
if (isset($category_feature_rotator) &amp;&amp; $category_feature_rotator != 0) {
$catidforgallery = $category_feature_rotator;
}
include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php');
?&gt;</pre>
<p>That will look for the custom field and use the category ID you put in for that custom field &#8211; and if it&#039;s not there &#8211; then it will just default to the category specified on the Featured Content Gallery options page.</p>
<p>IMPORTANT NOTE: If/when there is an update to the Feature Content Gallery plugin &#8211; upgrading will overwrite these changes. This post was written for version 3.2.0 of the plugin. Hopefully they&#039;ll build this feature in a next release of the plugin. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><strong>UPDATE 11/16/09</strong> <a href="http://ArtisanPhotography.com/">Greg</a> had asked in the comments about being able to do a similar technique with multiple featured content galleries, but being able to specify page IDs. He was able to solve the problem before I could and sent me the solution. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>To use Page IDs in the gallery:</strong> On the page you want to have the gallery displayed on, create a custom field with a key of &#034;pageids&#034; &#8211; and for the value, give a comma seperated list of page ids.</p>
<p>Where I had been pulling the &#034;category-feature-rotator&#034; custom field &#8211; replace that with the following:</p>
<pre class="brush: php;">$pageids = get_post_meta($post-&gt;ID, &quot;pageids&quot;, true);</pre>
<p>Then look for the following line in gallery.php (should be around 24)</p>
<pre class="brush: php;">$arr = split(&quot;,&quot;,get_option('gallery-items-pages'));</pre>
<p>and change it to this:</p>
<pre class="brush: php;">$arr = split(&quot;,&quot;,($pageids));</pre>
<p><em>*Note: I haven&#039;t personally tested the Page ID method &#8211; so if you try it &#8211; please report back how it goes&#8230;</em></p>


<p>Related posts:<ol><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>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/' rel='bookmark' title='Permanent Link: Delink Pages Plugin'>Delink Pages Plugin</a> <small>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin...</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/2009/10/30/multiple-featured-content-galleries/feed/</wfw:commentRss>
		<slash:comments>8</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/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/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/02/10/show-subnavigation-for-just-the-main-navsection-youre-in-wordpress/' rel='bookmark' title='Permanent Link: Show subnavigation for just the main nav/section you&#039;re in (WordPress)'>Show subnavigation for just the main nav/section you&#039;re in (WordPress)</a> <small>When you use wp_list_pages() &#8211; you get a full dump...</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/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/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/02/10/show-subnavigation-for-just-the-main-navsection-youre-in-wordpress/' rel='bookmark' title='Permanent Link: Show subnavigation for just the main nav/section you&#039;re in (WordPress)'>Show subnavigation for just the main nav/section you&#039;re in (WordPress)</a> <small>When you use wp_list_pages() &#8211; you get a full dump...</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>Two Blocks of Content for Pages in WordPress</title>
		<link>http://www.scriptygoddess.com/archives/2009/10/19/two-block-of-content-for-pages/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/10/19/two-block-of-content-for-pages/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 01:44:46 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1621</guid>
		<description><![CDATA[I just saw this plugin show up on the WordPress Plugins list. WOW! I haven&#039;t had a chance to use it yet, but can think of a dozen places where I can use this feature!!! Very excited to see it!
Secondary HTML Content &#8211; WordPress Plugin


Related posts:Multiple Featured Content Galleries On a site I was working [...]


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>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/' rel='bookmark' title='Permanent Link: Delink Pages Plugin'>Delink Pages Plugin</a> <small>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/02/09/10-wordpress-plugins-i-cant-live-without/' rel='bookmark' title='Permanent Link: 10 WordPress plugins I can&#039;t live without'>10 WordPress plugins I can&#039;t live without</a> <small>In honor of &#034;Thank a WordPress Plugin Developer&#034; (yes, I...</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 just saw this plugin show up on the WordPress Plugins list. WOW! I haven&#039;t had a chance to use it yet, but can think of a dozen places where I can use this feature!!! Very excited to see it!</p>
<p><a href="http://wordpress.org/extend/plugins/secondary-html-content/">Secondary HTML Content &#8211; WordPress Plugin</a></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>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/' rel='bookmark' title='Permanent Link: Delink Pages Plugin'>Delink Pages Plugin</a> <small>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/02/09/10-wordpress-plugins-i-cant-live-without/' rel='bookmark' title='Permanent Link: 10 WordPress plugins I can&#039;t live without'>10 WordPress plugins I can&#039;t live without</a> <small>In honor of &#034;Thank a WordPress Plugin Developer&#034; (yes, I...</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/19/two-block-of-content-for-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Delink Pages Plugin</title>
		<link>http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 17:57:57 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1619</guid>
		<description><![CDATA[(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin Version: 1.1.1 &#8211; see changelog at bottom of post)
I have been wanting to do more wordpress plugin development, but it has a somewhat steep learning curve. So I&#039;m testing the waters a bit here. I&#039;ve done some testing with the plugin, but feedback is appreciated. [...]


Related posts:<ol><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>
<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/06/conditionally-change-path-to-https/' rel='bookmark' title='Permanent Link: Conditionally change path to HTTPS'>Conditionally change path to HTTPS</a> <small>One of my clients had set it up so 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>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin Version: 1.1.1 &#8211; see changelog at bottom of post)</p>
<p>I have been wanting to do more wordpress plugin development, but it has a somewhat steep learning curve. So I&#039;m testing the waters a bit here. I&#039;ve done some testing with the plugin, but feedback is appreciated. For now, if you have problems with the plugin, leave a comment here. PLEASE include contact information (fill out the email field with a valid email address!!), a URL where you have the plugin installed, any errors you&#039;re getting, etc. The more information you give me, the more likely I will able to fix the problem. </p>
<h2>Plugin Description</h2>
<p>This plugin will allow you to specify certain pages to not be linked when wp_list_pages() is used in your theme. You might want to do this if you want a header for a series of subpages, but don&#039;t specifically want that header to be a real &#034;page&#034; or link.</p>
<p>For example &#8211; you have a series of pages like this:</p>
<ul>
<li><a href="#">About Our Company</a>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Management Team</a></li>
</ul>
</li>
<li><a href="#">Our Products</a></li>
<li><a href="#">etc etc etc</a></li>
</ul>
<p>As of version 1.1 of this plugin there are two ways you can go about doing this. You can either remove the link entirely. As in no &lt;a&gt; tag at all like this:</p>
<ul>
<li>About Our Company
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Management Team</a></li>
</ul>
</li>
<li><a href="#">Our Products</a></li>
<li><a href="#">etc etc etc</a></li>
</ul>
<p>OR you can remove the link to the actual page and sawp it out for a blank link to &#034;#&#034;.</p>
<h2>Usage</h2>
<p>To use the plugin, download the zip, and unzip the file. Install it by putting the scripty-delinkpage.php in your wp-content/plugins/ directory. Activate it through the WordPress admin. Then, on pages you do not want to have a link, add a custom field with a key of &#034;delink&#034; and a value of &#034;true&#034; when you want to remove the link completely, or a value of &#034;href&#034; when you want the href value to be &#034;#&#034;.</p>
<h2>Download</h2>
<p>You can download this plugin from wordpress.org plugin directory here: <a href="http://wordpress.org/extend/plugins/delink-pages/">Delink Pages</a></p>
<h2>Changelog</h2>
<p>Version 1.1.1<br />
Minor bug fix to preg_replace</p>
<p>Version 1.1<br />
Added option for delink to have a value of &#034;href&#034; when you want don&#039;t want the link to be removed entirely but be linked to &#034;#&#034;</p>
<p>Version 1.0<br />
Initial release</p>


<p>Related posts:<ol><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>
<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/06/conditionally-change-path-to-https/' rel='bookmark' title='Permanent Link: Conditionally change path to HTTPS'>Conditionally change path to HTTPS</a> <small>One of my clients had set it up so 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/2009/10/07/delink-pages-plugin/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Conditionally change path to HTTPS</title>
		<link>http://www.scriptygoddess.com/archives/2009/10/06/conditionally-change-path-to-https/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/10/06/conditionally-change-path-to-https/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 22:01:25 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1618</guid>
		<description><![CDATA[One of my clients had set it up so that one particular page in their WordPress install would load as https:// and even though they changed all links they could find in their template to use root-relative links, they were still getting complaints from IE about the page loading some secure and non-secure items. A [...]


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>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/' rel='bookmark' title='Permanent Link: Delink Pages Plugin'>Delink Pages Plugin</a> <small>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/' rel='bookmark' title='Permanent Link: open_basedir restriction in effect error on WordPress page'>open_basedir restriction in effect error on WordPress page</a> <small>This is the second time I&#039;ve run into this problem....</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 my clients had set it up so that one particular page in their WordPress install would load as https:// and even though they changed all links they could find in their template to use <a href="http://www.motive.co.nz/glossary/linking.php">root-relative link</a>s, they were still getting complaints from IE about the page loading some secure and non-secure items. A look through the source code revealed that two plugins in particular (an <a href="http://wordpress.org/extend/plugins/events-manager/">event manager plugin</a> and <a href="http://www.deliciousdays.com/cforms-plugin">cforms plugin</a>) pulled in their CSS or javascript files without the https. It probably got these settings from the main WordPress install, which wasn&#039;t set to use ALL https &#8211; the had just set it up so that this one page would be (using a special template for https pages). But there was no way to get that information to the plugin&#8230; So I needed to do a little hacking to the plugin(s) and add in a conditional statement that would check if the page being viewed was https &#8211; and if so, swap out http:// for https:// in the path to the file. </p>
<p>In the case of the cforms plugin, the file I had to modify was cforms.php &#8211; the line I found that pulled in the file path looks like this:</p>
<pre name="code" class="php">$cforms_root = $cformsSettings['global']['cforms_root'];</pre>
<p>So, just below that I added this:</p>
<pre name="code" class="php">if(isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "on") {
$cforms_root = str_replace("http://","https://",$cforms_root);
}</pre>
<p>Pretty simple. Of course, if/when we need to upgrade the plugin, the change will be overwritten &#8211; but it&#039;s pretty easy to add back in&#8230;</p>
<p><a href="http://www.deliciousdays.com/cforms-forum/troubleshooting/https-problems/">(Apparently, I&#039;m not the only one with this issue&#8230;)</a></p>
<p>In the case of the event manager plugin, the file I modified was dbem_events.php:</p>
<p>So just below this:</p>
<pre name="code" class="php">function dbem_general_css() {
$base_url = get_bloginfo('url');</pre>
<p>I added this:</p>
<pre name="code" class="php">if(isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "on") {
$base_url = str_replace("http://","https://",$base_url);
}</pre>
<p>No more complaints from IE.</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>
<li><a href='http://www.scriptygoddess.com/archives/2009/10/07/delink-pages-plugin/' rel='bookmark' title='Permanent Link: Delink Pages Plugin'>Delink Pages Plugin</a> <small>(Plugin and this post last updated: 10/20/2009 &#8211; Latest Plugin...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/' rel='bookmark' title='Permanent Link: open_basedir restriction in effect error on WordPress page'>open_basedir restriction in effect error on WordPress page</a> <small>This is the second time I&#039;ve run into this problem....</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/06/conditionally-change-path-to-https/feed/</wfw:commentRss>
		<slash:comments>0</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/08/29/simple-shortcode-for-line-breaks/' rel='bookmark' title='Permanent Link: Simple Shortcode for Line Breaks'>Simple Shortcode for Line Breaks</a> <small>One kind of funny thing with WordPress is that entering...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/08/28/playing-with-post-attachments/' rel='bookmark' title='Permanent Link: Playing with Post Attachments'>Playing with Post Attachments</a> <small>I&#039;ve been doing a ton of sites recently using 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>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/08/29/simple-shortcode-for-line-breaks/' rel='bookmark' title='Permanent Link: Simple Shortcode for Line Breaks'>Simple Shortcode for Line Breaks</a> <small>One kind of funny thing with WordPress is that entering...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/08/28/playing-with-post-attachments/' rel='bookmark' title='Permanent Link: Playing with Post Attachments'>Playing with Post Attachments</a> <small>I&#039;ve been doing a ton of sites recently using 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/09/27/adding-a-block-of-html-to-a-wordpress-post/feed/</wfw:commentRss>
		<slash:comments>0</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/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/' rel='bookmark' title='Permanent Link: open_basedir restriction in effect error on WordPress page'>open_basedir restriction in effect error on WordPress page</a> <small>This is the second time I&#039;ve run into this problem....</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/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>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/06/10/open_basedir-restriction-in-effect-error-on-wordpress-page/' rel='bookmark' title='Permanent Link: open_basedir restriction in effect error on WordPress page'>open_basedir restriction in effect error on WordPress page</a> <small>This is the second time I&#039;ve run into this problem....</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/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/09/12/search-from-wordpress-admin-post-listing-redirecting-to-home-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Anchor Links in WordPress Posts &#8211; another shortcode solution</title>
		<link>http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:10:27 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1614</guid>
		<description><![CDATA[I was recently asked by a client how they could easily add anchor links within a particularly long post they had made in WordPress. (Ie. a list of links at the top of the page that would jump the user down to the appropriate section where they needed to be.) I thought about maybe explaining [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/08/29/simple-shortcode-for-line-breaks/' rel='bookmark' title='Permanent Link: Simple Shortcode for Line Breaks'>Simple Shortcode for Line Breaks</a> <small>One kind of funny thing with WordPress is that entering...</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/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>I was recently asked by a client how they could easily add anchor links within a particularly long post they had made in WordPress. (Ie. a list of links at the top of the page that would jump the user down to the appropriate section where they needed to be.) I thought about maybe explaining to them to switch over the HTML tab and writing the HTML for the anchor links, but that step alone can sometimes really freak some clients out. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So I came up with a solution to the problem using shortcodes and using the &#034;build link&#034; button already in the WordPress edit post box.</p>
<p>So the first step is to create the code so the shortcode will work. If you don&#039;t already have a functions.php file in your template directory, make a new file, name it &#034;functions.php&#034; and add the following code (surrounded by &lt;?php and ?&gt;). If you do already have a functions.php file, add the following code within those php tags:</p>
<p><code>function anchorlink($atts) {<br />
	extract(shortcode_atts(array(<br />
			"id" =&gt; ''<br />
			), $atts));<br />
	return '&lt;a name="'.$id.'"&gt;&lt;/a&gt;';<br />
}<br />
add_shortcode('anchor', 'anchorlink');</code></p>
<p>Then, in your post. In front of the location you want to be able to create a link to add the following:</p>
<p><code>[anchor id="unique_id_here"]</code></p>
<p>So for example.. If your post is a &#034;Q/A&#034; type page, down where you have the full question and answer, add that shortcode:</p>
<p><code><strong>[anchor id="elephantquestion"]</strong>Q: What do elephants eat?<br />
A: Elephants eat mainly grass, leaves, bark and twigs. Sometimes they will also eat fruit and seeds.</code></p>
<p>Then at the top &#8211; where you probably have a list of all the questions on the page like this:</p>
<p><code>What do elephants eat?<br />
What do giraffes eat?<br />
etc.</code></p>
<p>(In this example) highlight the &#034;What do elephants eat&#034; text, click the LINK button in the edit post area &#8211; remove the &#034;http://&#034; that automatically is included in the link field that pops up and instead, add a pound symbol <strong>#</strong> and then the id you used:<br />
<img src="http://www.scriptygoddess.com/wp-content/uploads/2009/09/Screen-shot-2009-09-10-at-Sep-10-11.51.47-AM.png" alt="Screen shot 2009-09-10 at Sep 10  11.51.47 AM" title="Screen shot 2009-09-10 at Sep 10  11.51.47 AM" width="325" height="233" class="alignnone size-full wp-image-1615" /></p>
<p>I know this isn&#039;t a huge leap from simply writing the HTML that does this. But I&#039;ve found that some clients don&#039;t understand (and don&#039;t want to understand) HTML. This IS actually simpler for them. Especially when you might run into the scenario of someone forgetting to close the anchor tag with a &lt;/a&gt; &#8211; and suddenly the whole page is acting weird&#8230; I also think it&#039;s probably helpful to SEE the ID right there in plain text in the post &#8211; so that when you&#039;re making the links at the top, you can quickly see what the ID is that you need to link to.</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/08/29/simple-shortcode-for-line-breaks/' rel='bookmark' title='Permanent Link: Simple Shortcode for Line Breaks'>Simple Shortcode for Line Breaks</a> <small>One kind of funny thing with WordPress is that entering...</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/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/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 4.475 seconds -->
<!-- Cached page served by WP-Cache -->
