<?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>Propaganda Party</title>
	<atom:link href="http://blog.popstalin.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.popstalin.com</link>
	<description>The Pop Stalin Design Manifesto</description>
	<lastBuildDate>Sat, 11 Jul 2009 18:51:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPress Front Page Login &amp; a Sliding jQuery Panel</title>
		<link>http://blog.popstalin.com/articles/wordpress/wordpress-front-page-login</link>
		<comments>http://blog.popstalin.com/articles/wordpress/wordpress-front-page-login#comments</comments>
		<pubDate>Sat, 11 Jul 2009 18:42:22 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=355</guid>
		<description><![CDATA[Login, register or recover your WordPress password without leaving the page you're on using a sliding jQuery panel and the Ajax Login Widget++. It's super easy with a bit of PHP code and JavaScript. Never have Subscribers see wp-login.php again.]]></description>
			<content:encoded><![CDATA[<p>There are two things that are all the rage in web development at the moment&#8211;WordPress and jQuery. I&#8217;ve got a fairly decent handle on making WordPress do what I want it to but I&#8217;m at a loss when it comes to do with anything javascript related. I can&#8217;t code anything myself, so I&#8217;m one of the many people who set out to find the solution via Google and the talented developers who code nifty things. This is one of those nifty things I borrowed. A recent client wanted a way for Subscribers to his site to be able to log in, register or recover a lost password from the front page. This is the tale of how I accomplished that.<br />
<span id="more-355"></span><br />
When I went searching, I found what I thought was the perfect solution until I tried registering or logging in. Jeeremie over at Web-kreation has a sweet tutorial on implementing a <a href="http://web-kreation.com/index.php/wordpress/implement-a-nice-clean-jquery-sliding-panel-in-wordpress-27/">jQuery sliding panel in WordPress</a>. I followed the tutorial, I copied the code and everything worked like a peach except for that little problem I mentioned earlier. All his beautiful work that allowed me to have the forms in the sliding panel was for naught was you actually wanted to log in or register. Then you were taken away from the page and to dumped onto the regular old wp_login.php page. The breaks squealed and I scratched my head and thought, &#8220;Nope, this isn&#8217;t gonna work.&#8221; I figured there had to be something I could combine with his sliding panel code to make this do what I wanted it to do. That&#8217;s when I came across <a href="http://dound.com/projects/word-press/ajax-login-widget/">AJAX Login Widget++</a> written by David Underhill. Voila, magic! Now, it&#8217;s not the perfect solution because you have to fiddle with a file in the plugin folder but it works for what the client wants and that&#8217;s all that matters. Right? Right! Below is the code that I used to make this work. If you have questions, you can ask and I&#8217;ll do my best to answer but you may be better off going to the sites listed above and getting help from the creators of this goodness.</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;!-- Panel --&gt;
&lt;div id=&quot;toppanel&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #990000;">global</span> <span style="color: #000088;">$user_identity</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_ID</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// If user is logged in or registered, show dashboard links in panel</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_user_logged_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;panel&quot;&gt;
  &lt;div class=&quot;content clearfix&quot;&gt;
    &lt;div class=&quot;left border&quot;&gt;
      &lt;h1&gt;Welcome back <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #000088;">$user_identity</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;
      &lt;h2&gt;My Account&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/index.php&quot;&gt;Go to Dashboard&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/profile.php&quot;&gt;Edit My Profile&lt;/a&gt;&lt;/li&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_1'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/edit-comments.php&quot;&gt;Comments&lt;/a&gt;&lt;/li&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;nofollow&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Log out'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
          <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Log out'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div class=&quot;left narrow&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_10'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;h2&gt;Appearance&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/themes.php&quot;&gt;Themes&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/widgets.php&quot;&gt;Widgets&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/theme-editor.php&quot;&gt;Theme Editor&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;h2&gt;Plugins&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/plugins.php&quot;&gt;Plugins&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/plugin-install.php&quot;&gt;Install a Plugin&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/plugin-editor.php&quot;&gt;Plugin Editor&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/div&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;div class=&quot;left narrow&quot;&gt;
      &lt;h2&gt;Posts&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/post-new.php&quot;&gt;New Post&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/edit.php&quot;&gt;Edit Posts&lt;/a&gt;&lt;/li&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/edit-tags.php&quot;&gt;Tags&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/categories.php&quot;&gt;Categories&lt;/a&gt;&lt;/li&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;/ul&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;h2&gt;Pages&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/post-new.php&quot;&gt;New Page&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/edit-pages.php&quot;&gt;Edit Pages&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/div&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;div class=&quot;left narrow&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;h2&gt;Users&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/users.php&quot;&gt;Author &amp;amp; Users&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/user-new.php&quot;&gt;Add New&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;h2&gt;Library&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/upload.php&quot;&gt;Library&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/media-new.php&quot;&gt;Add New&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_10'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;div class=&quot;left narrow&quot;&gt;
      &lt;h2&gt;Settings&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-general.php&quot;&gt;General&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-writing.php&quot;&gt;Writing&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-reading.php&quot;&gt;Reading&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-discussion.php&quot;&gt;Discussion&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-media.php&quot;&gt;Media&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-privacy.php&quot;&gt;Privacy&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-permalink.php&quot;&gt;Permalinks&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/options-misc.php&quot;&gt;Miscellaneous&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- /login --&gt;
&lt;!-- The tab on top --&gt;
&lt;div class=&quot;tab&quot;&gt;
  &lt;ul class=&quot;login&quot;&gt;
    &lt;li class=&quot;left&quot;&gt; &lt;/li&gt;
    &lt;!-- Logout --&gt;
    &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;nofollow&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Log out'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Log out'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;/a&gt;&lt;/li&gt;
    &lt;li class=&quot;sep&quot;&gt;|&lt;/li&gt;
    &lt;li id=&quot;toggle&quot;&gt; &lt;a id=&quot;open&quot; class=&quot;open&quot; href=&quot;#&quot;&gt;Show Dashboard&lt;/a&gt; &lt;a id=&quot;close&quot; style=&quot;display: none;&quot; class=&quot;close&quot; href=&quot;#&quot;&gt;Close Panel&lt;/a&gt; &lt;/li&gt;
    &lt;li class=&quot;right&quot;&gt; &lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&lt;!-- / top --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #666666; font-style: italic;">// Else if user is not logged in, show login and register forms</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;panel&quot;&gt;
  &lt;div class=&quot;content clearfix&quot;&gt;
    &lt;div class=&quot;left border&quot;&gt;
      &lt;h1&gt;Put a Salutation Here&lt;/h1&gt;
      &lt;h2&gt;You can put even more stuff here.&lt;/h2&gt;
      &lt;p class=&quot;grey&quot;&gt;You can put anything you want in this sliding panel: videos, audio, images, forms... The only limit is your imagination!&lt;/p&gt;
    &lt;/div&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> add_ajax_login_widget<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/div&gt;
  &lt;!-- /login --&gt;
  &lt;!-- The tab on top --&gt;
  &lt;div class=&quot;tab&quot;&gt;
    &lt;ul class=&quot;login&quot;&gt;
      &lt;li class=&quot;left&quot;&gt;&amp;nbsp;&lt;/li&gt;
      &lt;!-- Login / Register --&gt;
      &lt;li id=&quot;toggle&quot;&gt; &lt;a id=&quot;open&quot; class=&quot;open&quot; href=&quot;#&quot;&gt;Log In | Register&lt;/a&gt; &lt;a id=&quot;close&quot; style=&quot;display: none;&quot; class=&quot;close&quot; href=&quot;#&quot;&gt;Close Panel&lt;/a&gt; &lt;/li&gt;
      &lt;li class=&quot;right&quot;&gt;&amp;nbsp;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;!-- / top --&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
&lt;!--END panel --&gt;</pre></td></tr></table></div>

<p>The nice thing about the way Jeeremie coded this, your WordPress Dashboard links are available to you by levels. For example, if you&#8217;re an Administrator of the site, then you will see all the links available that you would in the Dashboard. He separates them with some spiffy PHP based on user levels. </p>
<p>The code for the Ajax Login Widget++ is on line 119. </p>
<p>One more neat thing that another user, <a href="http://web-kreation.com/index.php/wordpress/implement-a-nice-clean-jquery-sliding-panel-in-wordpress-27/#comment-5541">Jonathan</a>, over at Web-kreation came up with is only showing the sliding panel to the admin. Here&#8217;s the code for that:</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level_10'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!-- Panel --&gt;
&lt;div id=&quot;toppanel&quot;&gt;
... ALL THE CODE FROM ABOVE GOES HERE...
&lt;/div&gt;&lt;!--END panel --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Of course, if you&#8217;re going to show the sliding panel only to the Admin, then you won&#8217;t need all the user level codes in the original code. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/wordpress/wordpress-front-page-login/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travelling Web Designer</title>
		<link>http://blog.popstalin.com/articles/business/travelling-web-designer</link>
		<comments>http://blog.popstalin.com/articles/business/travelling-web-designer#comments</comments>
		<pubDate>Sat, 11 Jul 2009 01:15:22 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=349</guid>
		<description><![CDATA[Off into the wild blue yonder, adding well-known organizations to my resume and making decent money to boot. In other words, how to limp along in this flagging economy. ]]></description>
			<content:encoded><![CDATA[<p>A lot of freelance designers have been struggling to keep their heads above water during these tough economic times. I&#8217;ve found a solution to my lack of business coming from those channels; contracting out via a &#8220;talent agency.&#8221; I just finished a two and half month stint at NPR.org working on their redesign doing production work. It was a nice experience and something I may keep in mind in the future, even when the economy turns itself around&#8230;whenever that may be.<br />
<span id="more-349"></span><br />
Now that the great NPR experience has ended, Monday I head off to PBS to work on their site redesign as a front-end developer. For the next six months I&#8217;ll have regular income coming in, I&#8217;ll have a hand in redesigning an organization&#8217;s site that is going to look really good on my resume and I&#8217;ll only have to commute an hour and fifteen minutes each way to get there. </p>
<p>The upside is that there are two Ethiopian restaurants within walking distance of their offices, I&#8217;ll be working in the state of Virginia again and most of the staff heading up the redesign at PBS used to work for AOL. I have a feeling I&#8217;ll be learning a lot at this gig. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/business/travelling-web-designer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a WordPress Magazine-esque Theme: Part II</title>
		<link>http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-2</link>
		<comments>http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-2#comments</comments>
		<pubDate>Mon, 20 Apr 2009 12:00:44 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=224</guid>
		<description><![CDATA[Second part in a three part series of how I created the theme for my blog using a magazine-esque layout and WordPress custom loops and queries.]]></description>
			<content:encoded><![CDATA[<h2>Single.php and Category pages</h2>
<p><a href="http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-1">In part 1</a>, I covered the code necessary to provide my home page functionality. In this segment, I&#8217;ll cover how I created the functionality for the single.php page and the category pages. The code for the single.php page closely mirrors the code for the index.php page with the addition of the comment code. Again, the process for creating these pages closely followed that of the index page&#8211;I created a prototype sketch, I fleshed it out in Photoshop and then I opened my text editor and started coding. <span id="more-224"></span></p>
<p>First, I wanted the single page to have roughly the same appearance as the index.php minus the additional posts below the &#8220;featured&#8221; post. I wanted the image to carry over into the post and I wanted the text to be the main emphasis on the page because that&#8217;s what a blog is all about in my opinion. I&#8217;ve seen lots of designs I like that had asides to the left or right of the post but in this incarnation, I wanted the reader to focus solely on the text of the post when clicking through. </p>
<h2>1. Single.php Code</h2>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// THIS IS WHERE MY META AND OTHER POST CONTENT GOES
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// THIS IS WHERE I PUT SOME SORT OF MESSAGE TELLING THE READER THEY'VE NOT FOUND WHAT THEY'RE LOOKING FOR
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// SOME MORE OF MY OWN CSS LAYOUT CODE
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_template<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// I CLOSE UP ALL MY OPEN DIV'S
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>As you can see, there are no custom loops or queries. The only &#8220;custom&#8221; code on this page is my CSS and the code I need to bring in the image from the custom field, which was covered in part 1. The real &#8220;exciting&#8221; stuff, actually takes place within the category pages so I&#8217;ll go over that in more detail next. </p>
<h2>2. Category Pages and the Template Hierarchy</h2>
<p>When visiting the WordPress Codex, I&#8217;ve often see the phrase &#8220;<strong>Template Hierarchy</strong>&#8221; but until this design, I&#8217;d never really read about it. What I learned was that if I wanted a different look or custom loops, I could use the hierarchy. The <strong>Template Hierarchy</strong> works like this; let&#8217;s say I have 5 categories and I want them each to have their own page. I can achieve this by creating a category page for each separate category and WordPress will look for a specific page for the category if I name the file the following way: <strong>category-5.php</strong>. The number in the file name is the actual number of the category so when a visitor clicks on, for example, <strong>Design</strong> and <strong>Design</strong> is <strong>category 5</strong> in the database, WordPress will serve that page using <strong>category-5.php</strong> instead of just <strong>category.php</strong> or <strong>archives.php</strong>. It&#8217;s a simple way to create unique pages per category without the hassle of really having to creating template files. </p>
<h2>3. Custom Loop for Category Pages</h2>
<p>The first thing you&#8217;ll see on each category page is the heading for that page. For example, in the business category, you&#8217;ll see &#8220;<strong>Business Articles</strong>.&#8221; That is handled dynamically by using the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> single_cat_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Articles&lt;/h2&gt;</pre></div></div>

<p>The PHP tells the database to spit out the category name or title. </p>
<p>The next thing you&#8217;ll see is the posts with excerpts. This is handled using a custom WordPress Query.</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$wp_query</span><span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$wp_query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'showposts=16&amp;cat=3,9'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;paged='</span><span style="color: #339933;">.</span><span style="color: #000088;">$paged</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>A very important part of this custom query is telling WordPress that this page will be&#8230;paged; meaning there is more than one page. In order to use a custom query, you must use that bit of PHP code or else your paging, whether you use a plugin or the built-in navigation of older or newer entries, won&#8217;t work. </p>
<p>The next important part of this query is indicating how many posts per page should be displayed and what categories to display. Since I have sub-categories set-up under the main categories, I want to make sure those show up as well.</p>
<h2>Styling My Category Pages</h2>
<p>An important part of the next piece of custom code was styling the most recent post differently (do you notice a trend?). I wanted that post to stand out from all the others for two reasons. It gives the reader a point of reference as to what&#8217;s important on the page and it helps break up the design a little. </p>
<p>I decided when planning my redesign that I didn&#8217;t want the typical archives. I wanted to display past articles in a different way starting with making the most recent article be prominent on the category page. I did this with a simple bit of code that I discovered through the <a href="http://wordpress.org/support/topic/212494">WordPress forums with the help of pshero</a>.  He too was looking for a way to style the most recent post differently than the rest and came up with the PHP code that would do the trick. Here is what I used to make the most recent post stand out on the category page.</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_paged<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$postclass</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'archivelist'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$postclass</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$posts</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'archivelist-featured'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'archivelist'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Then the above is applied to your div class the following way:</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #000088;">$postclass</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></td></tr></table></div>

<p>Basically, what this piece of code does is create a way to assign two classes to the posts on the page dynamically. If it&#8217;s the most recent post, then it is assigend &#8220;archivelist-featured&#8221; and any subsequent post is then tagged with &#8220;archivelist.&#8221; If you click on the link above, it will take you to the thread and explain in more detail different usage. </p>
<h2>4. Crossing the Finish Line</h2>
<p>After I make things pretty, we need to add some of the basic WordPress code to show the date, post title and the excerpt.</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;h3 class=&quot;meta&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_date<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m-d-y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &amp;#8249;&amp;#8250; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;
  &lt;h3&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h3&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>   
   &lt;/div&gt;&lt;!-- // END ARCHIVE LIST --&gt;    
   <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>We&#8217;re getting there. The last thing you may notice on the page, other than the footer, is the paged navigation. In order for that to work properly, you have to code it the following way:</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;navigation&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_pagenavi'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> wp_pagenavi<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>  
&lt;/div&gt;&lt;!-- // END NAVIGATION --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$wp_query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span> <span style="color: #000088;">$wp_query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>You&#8217;ll notice that we close the custom WordPress query <strong><em>after</em></strong> we call for the paged navigation. If you don&#8217;t do that, you&#8217;ll have your pagination showing up on every page, most likely not showing a correct page count.</p>
<h2>The End is Nigh</h2>
<p>In this post I covered using PHP to dynamically pass CSS classes to differentiate posts, I covered template hierarchy and its purpose and I covered paging and custom queries. I hope this is useful to folks and expanding on your WordPress coding foundation.</p>
<p>In part three, a much shorter article by far, I&#8217;ll cover what plug-in&#8217;s I&#8217;m using and why and the benefits of automated content.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Link Tank: April 19th</title>
		<link>http://blog.popstalin.com/articles/general/link-tank/link-tank-april-19th</link>
		<comments>http://blog.popstalin.com/articles/general/link-tank/link-tank-april-19th#comments</comments>
		<pubDate>Sun, 19 Apr 2009 14:32:58 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[Link Tank]]></category>
		<category><![CDATA[brushes]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=295</guid>
		<description><![CDATA[<h3>Here are some delicious links for your enjoyment and edumication:</h3>
<p><a href="http://www.highresolutiontextures.com/6-hi-res-wood-textures#more-196">6 hi-res wood textures &#124; highresolutiontextures.com</a> &#8211; 6 high quality images of various sorts of wood or bark.</p>
<p><a href="http://lostandtaken.com/blog/2009/4/17/a-little-dirty-8-subtle-grunge-textures.html">Lost and Taken &#8211; Lost and Taken &#8211; A Little Dirty: 8 Subtle Grunge&#160;Textures</a> &#8211; A Little Dirty: 8 Subtle Grunge&#8230;</p>]]></description>
			<content:encoded><![CDATA[<h3>Here are some delicious links for your enjoyment and edumication:</h3>
<p><a href="http://www.highresolutiontextures.com/6-hi-res-wood-textures#more-196">6 hi-res wood textures | highresolutiontextures.com</a> &#8211; 6 high quality images of various sorts of wood or bark.</p>
<p><a href="http://lostandtaken.com/blog/2009/4/17/a-little-dirty-8-subtle-grunge-textures.html">Lost and Taken &#8211; Lost and Taken &#8211; A Little Dirty: 8 Subtle Grunge&nbsp;Textures</a> &#8211; A Little Dirty: 8 Subtle Grunge Textures</p>
<p><a href="http://qbrushes.com/photoshop-abstract-brushes/photoshop-light-brushes/">Photoshop Light brushes | Qbrushes &#8211; Photoshop Brushes</a> &#8211; Blurry light Brushes (Bokeh), 3 shapes (circle, hexagon, octagon), 9 brushes total.</p>
<p><a href="http://qbrushes.com/misc/skyline-brushes/">Photoshop Skyline Brushes | Qbrushes &#8211; Photoshop Brushes</a> &#8211; A set of 9 wonderful city skyline brushes for Photoshop 7 and up. Sizes range from 1000px to 1300px.</p>
<p><a href="http://qbrushes.com/grunge/valley-of-the-dry-bones-3/">Grungy Brushes from QBrushes</a> &#8211; Valley of the Dry Bones is a set of grunge brushes by seudavi with an average size of 1500px/</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/general/link-tank/link-tank-april-19th/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a WordPress Magazine-esque Theme: Part I</title>
		<link>http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-1</link>
		<comments>http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-1#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:00:11 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=222</guid>
		<description><![CDATA[First part in a three part series of how I created the theme for my blog using a magazine-esque layout and WordPress custom loops and queries.]]></description>
			<content:encoded><![CDATA[<h2>The Creation of Manifesto &#8216;09</h2>
<p>When I thought about the redesign of my blog, I wanted something that had a magazine feel to it but not the full functionality of a magazine theme. I didn’t need to display sections for different categories because I still wanted to run a blog and not a magazine&#8211;though in the future I could see myself actually adding that sort of functionality and turn my blog into a magazine. <span id="more-222"></span></p>
<p>I looked at all the available magazine layout themes, both paid and free, to get a feel for what it is that I like about them. The recurring theme that I liked about magazine layouts is the grid system. So I put pencil to paper and began sketching box after box attempting to get a simple grid layout that would satisfy my desire to have a magazine-esque layout. After a prototype or ten I had my creative juices flowing pretty well. I fired up Photoshop and played with color and layout until I came close to the design you see now. Just a side note, when it comes to my own sites, I often deviate from my Photoshop concepts after I start coding. For example, in my design concept, my footer was part of the five regular posts (limiting my posts to 4 on the front page). After playing about a bit with widths and other CSS styles, I decided to actually create a footer and use that space for additional posts.</p>
<p>After getting a close approximation of what I wanted it to look like, I started to think about how it would function. I wasn&#8217;t wild about the idea of having to create a &#8220;featured&#8221; category just to have a featured post. If I had a featured category, did I want to link to it and if I didn’t, what was the point of having a featured category to begin with. After deciding that a featured category was not an option, I looked for plugin’s but I didn&#8217;t want to use theme to achieve that option either. I decided not to allow my limited PHP knowledge hold me back from what I knew WordPress can do.</p>
<p>I set about researching my options and custom loops, finally figuring out a way to mix CSS and PHP to get what I wanted on the front page. I know there are probably ways that accomplish this with less code or more complex functions but I’m working within my abilities of PHP coding and learning as I go. </p>
<p>Without further ado, here’s how I accomplished my front page layout.</p>
<h2>1. Featured Post Custom Loop Code</h2>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000088;">$featured</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$featured</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_per_page=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$featured</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$featured</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
// THIS IS WHERE MY META AND OTHER POST CONTENT GOES
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The third line of code starts the loop. It tells WordPress that there&#8217;s a new database query about to happen. The fourth line of code tells the database to give us one post and the most recent one at that. The fifth line tells the database that the loop begins now if there is a post. The area of greatest interest for my needs is <strong>posts_per_page</strong>. Since my newest post was going to be &#8220;featured&#8221; I only wanted to show one and stop. Once I had that working, I went on the implement the second custom loop to display the additional posts on the front page.</p>
<h2>2. Regular Posts Custom Loop Code</h2>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000088;">$asides</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$asides</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_per_page=5&amp;offset=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$asides</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$asides</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
// THIS IS WHERE I PUT MY CODE FOR THE ADDITIONAL POST TITLES AND EXCERPTS
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>On line #11 I have similar code as the original query but I go a bit further in telling the database what I&#8217;m looking for. I want to display 5 posts now but I don&#8217;t want to show the &#8220;featured&#8221; or first post, so I tell the database to retrieve 5 posts but to ignore the first or newest one, which is what <strong>offset=1</strong> does. If I were displaying 3 featured posts, I would set the offset at <strong>offset=3</strong>.</p>
<p>Another bit of custom coding I did was to use <strong>custom fields</strong> to display an image in my featured post. The nice part of this code, is that if I don&#8217;t want to attach an image to the post, I don&#8217;t end up getting any errors because of a missing image. First, I went into the <strong>Add New Post</strong> screen and created a <strong>custom field</strong> called <strong>featuredImage</strong>. Then I put the following code in my index.php and category.php templates.</p>
<h2>3. Custom Fields for Featured Images</h2>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> get_post_custom_values<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;featuredImage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;featured-img&quot;&gt;
&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> get_post_custom_values<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;featuredImage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">echo</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Image&quot; /&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The second line of code is the variable that the third line of code works with to see if there is a value to display. If the value isn&#8217;t null, then my div class gets printed. If the value is null, then nothing gets printed at all, i.e., if you look at the source code, there is no image because I didn&#8217;t specify one in my post.</p>
<h2>Wrapping Up Part 1</h2>
<p>If you&#8217;re reading this article, you know the power of WordPress and are probably trying to harness that power to customize your site. What I&#8217;ve posted is how I handled having a &#8220;featured&#8221; post and not having to have a &#8220;featured&#8221; category in order to have a different style for my first post. I hope this post helps some folks because I wasn&#8217;t able to find a tutorial (or code) that showed how to accomplish this. </p>
<p>In the <a href="http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-2">next part</a> of this three part series, I&#8217;ll talk about how I accomplished the layout of my category pages&#8211;and in my case my archives as well, since they serve the same purpose. After coding my index.php page, I discovered another way that is much cleaner code to achieve having the first post having a different look than the rest. I used that method on the category pages so stay tuned to part two to learn how to use a custom loop and PHP to call specific CSS for your first post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/wordpress/manifesto-09-wordpress-theme-part-1/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Link Tank: April 14th</title>
		<link>http://blog.popstalin.com/articles/general/link-tank/link-tank-april-14th</link>
		<comments>http://blog.popstalin.com/articles/general/link-tank/link-tank-april-14th#comments</comments>
		<pubDate>Tue, 14 Apr 2009 21:00:20 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[Link Tank]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=234</guid>
		<description><![CDATA[<h3>Here are some delicious links for your enjoyment and edumication:</h3>
<p><a href="http://wefunction.com/2009/04/quality-within-web-design/">Function Web Design &#38; Development [ Blog ] &#187; How to Spot Quality within Web Design: Examples &#38; Tips</a> &#8211; Tips from the folks at Function Web Design &#38; Development on what constitutes quality web design. I&#8230;</p>]]></description>
			<content:encoded><![CDATA[<h3>Here are some delicious links for your enjoyment and edumication:</h3>
<p><a href="http://wefunction.com/2009/04/quality-within-web-design/">Function Web Design &amp; Development [ Blog ] &raquo; How to Spot Quality within Web Design: Examples &amp; Tips</a> &#8211; Tips from the folks at Function Web Design &amp; Development on what constitutes quality web design. I don&#39;t agree with everything written but there are some things that they bring up that make a whole lot of sense. Especially the whole &quot;attention to details&quot; part. It&#39;s the minutiae in design that takes it to the next level.</p>
<p><a href="http://versionsapp.com/">Versions &#8211; Mac Subversion Client (SVN)</a> &#8211; Versions, as the title says is a Mac Subversion client. However, that&#39;s not why I bookmarked this site. The simplicity of the design astounds me yet it&#39;s so well done and has quite an impact. You&#39;re to notice their brand, and boy, do you.</p>
<p>Of course, it&#39;s also a useful piece of software for those of us Mac users who want to use version control.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/general/link-tank/link-tank-april-14th/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yearly Redesign Completed</title>
		<link>http://blog.popstalin.com/articles/design/yearly-redesign-completed</link>
		<comments>http://blog.popstalin.com/articles/design/yearly-redesign-completed#comments</comments>
		<pubDate>Tue, 14 Apr 2009 06:43:12 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/?p=217</guid>
		<description><![CDATA[New curtains, fresh coat of paint and some general spring cleaning brings about Manifesto '09; the yearly redesign of my blog is complete...almost. ]]></description>
			<content:encoded><![CDATA[<p>New curtains, fresh coat of paint and some general spring cleaning brings about Manifesto &#8216;09; the yearly redesign of my blog.  There are still a few things that I need to take care of tomorrow (later today) but it&#8217;s 99.9% completed. I have to play some more with the branding area because it&#8217;s not displaying as it should and I had to implement a quick fix for the time being. You&#8217;ll notice there are some issues with the drop shadow&#8230; that&#8217;s the quick fix I had to throw up there. <span id="more-217"></span></p>
<p>For whatever reason, the div (which is actually an h1 tag, didn&#8217;t want to center in IE7 and when I finally got it to center, then it wouldn&#8217;t go the whole way across the screen. It stopped at the edges of the #wrapper container&#8230; which is odd because the branding graphic isn&#8217;t even inside the #wrapper container. I&#8217;m sure I&#8217;m missing something simple but I&#8217;m too tired to find it right now.</p>
<p>I plan on writing about my experience with the coding of the site and what I had to do as far as custom loops and such to &#8220;bend&#8221; WordPress to my will. Of course, I was pretty sure a few times WordPress was bending me to its will.</p>
<p>If you come across anything out of place in IE7 or 8, please let me know. I don&#8217;t have access to anything but IE7 and though I tried some of the free browser services online they can only help so much. Funny enough, after I decided that I wasn&#8217;t going to support IE 6, I had to create a special stylesheet just for IE7 because the navigation was 1 pixel off in Explorer. Gotta love it. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/design/yearly-redesign-completed/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE6 and My Blog Redesign</title>
		<link>http://blog.popstalin.com/articles/css/ie6-and-my-blog-redesign</link>
		<comments>http://blog.popstalin.com/articles/css/ie6-and-my-blog-redesign#comments</comments>
		<pubDate>Sat, 11 Apr 2009 16:15:59 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/ie6-and-my-blog-redesign/</guid>
		<description><![CDATA[Making the decision to leave behind IE6 for my personal blog wasn't a hard one. I still feel as a professional, it's within my professional standards to support that horrible, antiquated browser but in my personal life it's bye-bye IE6.]]></description>
			<content:encoded><![CDATA[<p>Hey all (or all <em>two</em> of you)! I&#8217;m in the process of doing my yearly blog redesign and I&#8217;ve made the big decision <a href="http://www.bringdownie6.com/">not to support IE6</a> when the redesign is deployed. I&#8217;ll still continue to hack away for clients who insist that their IE6 crowd stays pleased but I figure the small amount of visitors I get overall probably <strong>aren&#8217;t</strong> using IE6 to begin with and the few who are, will still be able to get the information, it just won&#8217;t be pretty (they&#8217;ll also get a nice little message at the top of the page urging them to upgrade).  <span id="more-179"></span></p>
<h2>The Redesign</h2>
<p>In the redesign I am trying something new for me that will, hopefully, help with some IE6 issues off the bat. First, I&#8217;m employing a modified version of <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer&#8217;s reset.css</a>&#8211;I&#8217;m going to zero everything out and start from scratch. Second, I&#8217;m going to use the <strong><em>strict</em></strong> XHTML doc type opposed to transitional&#8211;IE6 is quirky enough without putting it in quirks mode. Third, I&#8217;m going to attempt to make the layout as semantic as possible&#8211;my goal is to use less div&#8217;s. Finally, I&#8217;m wading into the position:relative and position:absolute waters. I&#8217;m using some shadow effects for my design and instead of using a lot of drop-shadowed graphics, I figure if I layer things, I need two graphics instead of ten (not a real number, just tossing it out there). Another thing I&#8217;m going to attempt to do is change the way I name things. I read a great article written by Andy Clarke called &#8220;<a href="http://forabeautifulweb.com/blog/about/more_on_developing_naming_conventions_microformats_and_html5/">More on developing naming conventions, Microformats and HTML5</a>&#8221; and am going to attempt to use his model for my mark-up.</p>
<p>The redesign will be a learning process for me and that is a good thing in my mind. I&#8217;d say I have a fair handle on CSS, except for the matters I stated above, and it&#8217;s about time I master those as well. It&#8217;s been an interesting proposition thus far and I&#8217;m enjoying and frustrated by it in equal parts. Hopefully, things will work fairly well in IE6 (except for the PNG graphics that allow the transparency I&#8217;ll need) without creating a separate stylesheet or hacking my way to get an eight year old browser to behave as current browsers do. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/css/ie6-and-my-blog-redesign/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Custom Fields for Post Images</title>
		<link>http://blog.popstalin.com/articles/wordpress/using-custom-fields-for-post-images</link>
		<comments>http://blog.popstalin.com/articles/wordpress/using-custom-fields-for-post-images#comments</comments>
		<pubDate>Mon, 06 Apr 2009 21:50:31 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/using-custom-fields-for-post-images/</guid>
		<description><![CDATA[<p>Sometimes a site may want a &#8220;featured&#8221; section with some text and an image. If you&#8217;re using <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> to achieve this, you may want a way to keep an empty value to display. Meaning, sometimes you don&#8217;t always add the image but if in the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Sometimes a site may want a &#8220;featured&#8221; section with some text and an image. If you&#8217;re using <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> to achieve this, you may want a way to keep an empty value to display. Meaning, sometimes you don&#8217;t always add the image but if in the template you have the code to automatically pull in the image custom field, then you&#8217;ll either get alt text in place of the image or a big red &#8216;x&#8217;. Here&#8217;s a small snippet of code that will return nothing if nothing is there.</p>
<p>Just place the following code where you would normally place your custom field code:</p>

<div class="wp_syntax"><table summary="Highlighted Code"><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> php
<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> get_post_custom_values<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Your-Custom-Field-Value&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'site_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-content/uploads/&gt;?php $values = get_post_custom_values(&quot;Your-Custom-Field-Value&quot;); echo $values[0]; ?&gt;&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span> php <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>If you write a post that doesn&#8217;t have an image, you won&#8217;t get any of those pesky errors. Thanks goes to authors on the WordPress forums for their efforts in helping folks who aren&#8217;t as well-versed in PHP coding as we&#8217;d like to be. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/wordpress/using-custom-fields-for-post-images/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6, PNGs and WordPress&#8211;It&#8217;s a Party!</title>
		<link>http://blog.popstalin.com/articles/wordpress/ie6-pngs-and-wordpress-its-a-party</link>
		<comments>http://blog.popstalin.com/articles/wordpress/ie6-pngs-and-wordpress-its-a-party#comments</comments>
		<pubDate>Thu, 02 Apr 2009 13:00:19 +0000</pubDate>
		<dc:creator>Jen</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.popstalin.com/ie6-pngs-and-wordpress-its-a-party/</guid>
		<description><![CDATA[I am all about the current movement to stop designing for IE6 but being the cautious woman that I am, I'm gonna wait for the numbers to go down just a bit more. I've tried a couple of the plugin's I've found for PNG transparency and still found myself looking at gray boxes in IE6. *Shakes fist in anger at IE6*]]></description>
			<content:encoded><![CDATA[<p>I am all about the current movement to stop designing for IE6 but being the cautious woman that I am, I&#8217;m gonna wait for the numbers to go down just a bit more. I&#8217;ve tried a couple of the plugin&#8217;s I&#8217;ve found for PNG transparency and still found myself looking at gray boxes in IE6. *Shakes fist in anger at IE6*</p>
<p>Then I came across this <a href="http://blog.nkadesign.com/2006/wordpress-fixing-png-transparency-issues-in-ie/">very old post</a> and it seems to have solved my woes and the gray boxes are now a thing of the past (finger&#8217;s crossed). Here&#8217;s the technique:</p>
<p>In your WordPress theme folder&#8211;wp-content/themes/&#8211;upload the following two files (from the link above)&#8211;blank.gif and pngbehavior.htc </p>
<p>Then add the following code to your stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Fix for PNG alpha channel display in IE6 */</span>
img <span style="color: #00AA00;">&#123;</span>
 behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;/wp-content/themes/pngbehavior.htc&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.popstalin.com/articles/wordpress/ie6-pngs-and-wordpress-its-a-party/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
