<?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>Schnipsel - Code Schnipsel (Snippets) zu Wordpress, PHP, HTML, CSS, jQuery &#187; Wordpress</title>
	<atom:link href="http://schnipsel.davidhellmann.com/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://schnipsel.davidhellmann.com</link>
	<description>Code Schnipsel (Snippets) zu Wordpress, PHP, HTML, CSS, jQuery</description>
	<lastBuildDate>Tue, 08 Mar 2011 00:20:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Little Snapper Bookmarklet</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/little-snapper-bookmarklet/70</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/little-snapper-bookmarklet/70#comments</comments>
		<pubDate>Thu, 08 Oct 2009 07:36:12 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[little snapper]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=70</guid>
		<description><![CDATA[Praktisch und gut! Einfach per klick Screenshots in Little Snapper erstellen. 1 javascript:location.href='littlesnapper://snap/'+location.href;]]></description>
			<content:encoded><![CDATA[<p>Praktisch und gut! Einfach per klick Screenshots in <a href="http://realmacsoftware.com/littlesnapper/">Little Snapper</a> erstellen.</p>
<span id="more-70"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">javascript<span style="color: #339933;">:</span>location<span style="color: #339933;">.</span>href<span style="color: #339933;">=</span><span style="color: #0000ff;">'littlesnapper://snap/'</span><span style="color: #339933;">+</span>location<span style="color: #339933;">.</span>href<span style="color: #339933;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/little-snapper-bookmarklet/70/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tweet This mit WordPress</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/tweet-this-mit-wordpress/69</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/tweet-this-mit-wordpress/69#comments</comments>
		<pubDate>Wed, 07 Oct 2009 14:37:15 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=69</guid>
		<description><![CDATA[Twitter ist &#252;berall! Hier ein kleiner Schnipsel zum einfachen einbinden in WordPress. Das ganze kommt von Frank Bueltge und von René. Die Funktion kommt einfach in die functions.php im Themeordner. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /** * get a short/tiny url * @author: [...]]]></description>
			<content:encoded><![CDATA[<p>
Twitter ist &#252;berall! Hier ein kleiner Schnipsel zum einfachen einbinden in WordPress. Das ganze kommt von <a href="http://bueltge.de/tweet-this-mit-wordpress/875/">Frank Bueltge</a> und von <a href="http://www.rene-ade.de/inhalte/php-code-zum-erstellen-einer-tinyurl-ueber-tinyurl-com-api.html">René</a>.
</p>
<span id="more-69"></span>
<p>Die Funktion kommt einfach in die <strong>functions.php</strong> im <strong>Themeordner</strong>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * get a short/tiny url
 * @author: René Ade
 * @link: http://www.rene-ade.de/inhalte/php-code-zum-erstellen-einer-tinyurl-ueber-tinyurl-com-api.html
 */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fb_gettinyurl'</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;">function</span> fb_gettinyurl<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$url</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'http://tinyurl.com/api-create.php?url='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</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: #000088;">$fp</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$tinyurl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$fp</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: #000088;">$tinyurl</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tinyurl</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$tinyurl</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$fp</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>



<p>Eingebunden an der jeweiligen Wunschstelle der Seite wird es dann wie folgt:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;a class=&quot;tweetthis&quot; href=&quot;http://twitter.com/home?status=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Lohnenswert: '</span> <span style="color: #339933;">.</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> fb_gettinyurl<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; title=&quot;Tweet this&quot;&gt;
	&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;">'stylesheet_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/layout/tweetthis.jpg&quot; border=&quot;0&quot; /&gt;
&lt;/a&gt;</pre></td></tr></table></div>



<p>Bei Twitter erscheint dann das hier: <strong>Lohnenswert: Titel des Beitrags http://tinyurl...</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/tweet-this-mit-wordpress/69/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Eine Seite ausgeben</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-eine-seite-ausgeben/68</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-eine-seite-ausgeben/68#comments</comments>
		<pubDate>Wed, 12 Aug 2009 05:46:11 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[pages]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=68</guid>
		<description><![CDATA[Will man sich zum Beispiel eigene Landingpages bauen oder auch nur die Startseite individuell gestalten braucht man hin und wieder einzelne Seiten die man einf&#252;gen m&#246;chte. Zum Beispiel einen kleinen About Text auf der Startseite oder &#228;hnliches. Mit dem folgenden Code kann man ganz einfach an Hand der Seiten ID diese anzeigen lassen. 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>
Will man sich zum Beispiel eigene Landingpages bauen oder auch nur die Startseite individuell gestalten braucht man hin und wieder einzelne Seiten die man einf&#252;gen m&#246;chte. Zum Beispiel einen kleinen About Text auf der Startseite oder &#228;hnliches. Mit dem folgenden Code kann man ganz einfach an Hand der Seiten ID diese anzeigen lassen.
</p>
<span id="more-68"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
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: #666666; font-style: italic;">// retrieve one post with an ID of 5</span>
	query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page_id=9'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$more</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// set $more to 0 in order to only get the first part of the post</span>
	<span style="color: #000088;">$more</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</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>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>
	&lt;h2&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;/h2&gt;
  	<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the full post »'</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;">endwhile</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-eine-seite-ausgeben/68/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Shortcodes erstellen</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-shortcodes-erstellen/64</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-shortcodes-erstellen/64#comments</comments>
		<pubDate>Tue, 30 Jun 2009 06:38:23 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Shortcodes]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=64</guid>
		<description><![CDATA[Wenn man zum Beispiel einen oft wiederkehrende Zeichenfolge hat und man diese nicht immer schreiben m&#246;chte von Hand k&#246;nnte man die mit Shortcodes machen. 1 2 3 4 5 6 &#60;?php function makebetterwebsites&#40;&#41; &#123; return 'Make Better Websites - Webseitengallery f&#252;r wundersch&#246;ner und eindrucksvolle Webseiten.'; &#125; &#160; add_shortcode&#40;'mbw', 'makebetterwebsites'&#41;; ?&#62; Jetzt m&#252;sste man in WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man zum Beispiel einen oft wiederkehrende Zeichenfolge hat und man diese nicht immer schreiben m&#246;chte von Hand k&#246;nnte man die mit Shortcodes machen.
</p>
<span id="more-64"></span>


<div class="wp_syntax"><table><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: #000000; font-weight: bold;">function</span> makebetterwebsites<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'Make Better Websites - Webseitengallery für wunderschöner und eindrucksvolle Webseiten.'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mbw'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'makebetterwebsites'</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>
Jetzt m&#252;sste man in WordPress bei einem Artikel (HTML Editor) einfach [mbw] einsetzen und es w&#252;rde der Text: "Make Better Websites - Webseitengallery f&#252;r wundersch&#246;ner und eindrucksvolle Webseiten." erscheinen. 
</p>
<p>
Da kommt mir gerade die Idee, ob es so vielleicht m&#246;glich w&#228;re ganze Codeschnipsel die man oft braucht (z. B. Letzte Artikel ausgeben) einfach in solche Shortcodes packen k&#246;nnte und somit in den Templates relativ wenig code hat. Wer kann was dazu sagen?
<br /><br />
<strong>***UPDATE***</strong><br />
Ein kurzer plausch mit <a href="http://www.bueltge.de">Frank</a> und es kam raus das das so nicht m&#246;glich w&#228;re aber er hat mich auf eine andere Sache gesto&#223;en die im grunde &#228;hnlich einfach ist :)
</p>]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-shortcodes-erstellen/64/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Artikel anzeigen lassen (Loop)</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-artikel-anzeigen-lassen/55</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-artikel-anzeigen-lassen/55#comments</comments>
		<pubDate>Wed, 27 May 2009 07:41:38 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Loop]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=55</guid>
		<description><![CDATA[Man kann ganz einfach Artikel auch woanders anzeigen lassen. Fern von der "index.php". Mann muss nur die Kategorien angeben und die Anzahl der Beitr&#228;ge die angezeigt werden sollen. Somit kann man &#252;berall Artikel ausgeben. Zum Beispiel f&#252;r weiter Artikel in der Sidebar oder &#228;hnliches. In folgenden Beispielt w&#252;rden aus der Kategorie (1, 2, 3) 20 [...]]]></description>
			<content:encoded><![CDATA[<p>
Man kann ganz einfach Artikel auch woanders anzeigen lassen. Fern von der "<strong>index.php</strong>". Mann muss nur die Kategorien angeben und die Anzahl der Beitr&#228;ge die angezeigt werden sollen. Somit kann man &#252;berall Artikel ausgeben. Zum Beispiel f&#252;r weiter Artikel in der Sidebar oder &#228;hnliches. In folgenden Beispielt w&#252;rden aus der Kategorie (1, 2, 3) 20 Artikel angezeigt werden (insgesamt).
</p>
<span id="more-55"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</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: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$myPosts</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$myPosts</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</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;">$my_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;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cat=1,2,3&amp;showposts=20&amp;orderby=date'</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: #000088;">$my_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: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_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;">$my_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: #000088;">$myPosts</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;h2&gt;&lt;a id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<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; 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; rel=&quot;bookmark&quot; title=&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;<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;/h2&gt;
&lt;div class=&quot;content&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<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;
<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;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-artikel-anzeigen-lassen/55/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>CushyCMS &#8211; Metadaten pflegbar machen</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/cushycms-metadaten-pflegbar-machen/53</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/cushycms-metadaten-pflegbar-machen/53#comments</comments>
		<pubDate>Tue, 26 May 2009 09:12:03 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[CushyCMS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=53</guid>
		<description><![CDATA[Mit CushyCMS kann man &#252;ber einen kleinen Umweg und mit Hilfe von PHP auch Sachen pflegen, die nicht in einem HTML-Element stehen sollen, zum Beispiel Metadaten. Das ist die HTML-Seite die sp&#228;ter mit CushyCMS gepflegt wird: 1 &#60;div class=&#34;cushycms-text&#34; title=&#34;Keywords&#34;&#62;Keywords, Das ist ein Keyword, Noch ein Keyword&#60;/div&#62; Und das macht man dann in den Head-Tag [...]]]></description>
			<content:encoded><![CDATA[<p>Mit CushyCMS kann man &#252;ber einen kleinen Umweg und mit Hilfe von PHP auch Sachen pflegen, die nicht in einem HTML-Element stehen sollen, zum Beispiel Metadaten.</p>

<span id="more-53"></span>

<p>Das ist die HTML-Seite die sp&#228;ter mit CushyCMS gepflegt wird:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;cushycms-text&quot; title=&quot;Keywords&quot;&gt;Keywords, Das ist ein Keyword, Noch ein Keyword&lt;/div&gt;</pre></td></tr></table></div>




<p>Und das macht man dann in den Head-Tag an die Stelle, an der die pflegbaren Keywords eingebunden werden sollen:</p>


<div class="wp_syntax"><table><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;">$keywords</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'keywords_cushy.html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
	<span style="color: #000088;">$array_suchen</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;div class=&quot;cushycms-text&quot; title=&quot;Keywords&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
	<span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array_suchen</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$keywords</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;meta name=&quot;keywords&quot; content=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$keywords</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/cushycms-metadaten-pflegbar-machen/53/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; dynamischer Seitentitel</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-dynamischer-seitentitel/38</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-dynamischer-seitentitel/38#comments</comments>
		<pubDate>Wed, 13 May 2009 12:54:16 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=38</guid>
		<description><![CDATA[Man ist auf der Startseite und es wird im Tab des Browsers ein Titel angezeigt. Bei vielen Seiten ist es so, dass egal wo man sich auf der Seite befindet, der Titel immer der gleiche ist. Ein kleiner PHP Schnipsel fragt den Seitentyp ab und vergibt den Titel. Das ganze kommt in die "header.php" und [...]]]></description>
			<content:encoded><![CDATA[<p>
Man ist auf der Startseite und es wird im Tab des Browsers ein Titel angezeigt. Bei vielen Seiten ist es so, dass egal wo man sich auf der Seite befindet, der Titel immer der gleiche ist. Ein kleiner PHP Schnipsel fragt den Seitentyp ab und vergibt den Titel. Das ganze kommt in die "<strong>header.php</strong>" und muss das hier ersetzen: <strong>< title >bla blub< /title ></strong>.
</p>
<span id="more-38"></span>


<div class="wp_syntax"><table><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
</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;">echo</span> <span style="color: #0000ff;">'	&lt;title&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_home<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: #666666; font-style: italic;">// Blog's Home</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Home - '</span> <span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'start'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Single blog post or page</span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> or is_page<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: #666666; font-style: italic;">// Single blog post or page</span>
	wp_title<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: #b1b100;">echo</span> <span style="color: #0000ff;">' - '</span> <span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_category<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: #666666; font-style: italic;">// Archive: Category</span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &amp;raquo; Kategorie: '</span><span style="color: #339933;">;</span> single_cat_title<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: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_day<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: #666666; font-style: italic;">// Archive: By day</span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &amp;raquo; Alle Weblogartikel vom '</span> <span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'. '</span> <span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_month<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: #666666; font-style: italic;">// Archive: By month </span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &amp;raquo; Alle Weblogartikel vom '</span> <span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_year<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: #666666; font-style: italic;">// Archive: By year</span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &amp;raquo; Alle Weblogartikel vom Jahr '</span> <span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_search<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: #666666; font-style: italic;">// Search</span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &amp;raquo; Suche:  	&amp;lsaquo;'</span> <span style="color: #339933;">.</span> wp_specialchars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;rsaquo;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> is_404<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: #666666; font-style: italic;">// 404</span>
	<span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'  &amp;raquo; 404 - Angeforderte Seite nicht gefunden'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Everything else. Fallback</span>
	bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> wp_title<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: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/title&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-dynamischer-seitentitel/38/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Post Revisions deaktivieren</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-post-revisions-deaktivieren/37</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-post-revisions-deaktivieren/37#comments</comments>
		<pubDate>Wed, 13 May 2009 09:08:14 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=37</guid>
		<description><![CDATA[Wordpress hat die Post Revisions standardm&#228;&#223;ig aktiviert. Dadurch sammeln sich viele Daten in der Datenbank. Wer es nicht ben&#246;tigt kann das ganz einfach abschalten. Und war muss einfach folgenden Codezeile in die "config.php" geschrieben werden. 1 define&#40;'WP_POST_REVISIONS', False&#41;;]]></description>
			<content:encoded><![CDATA[<p>
Wordpress hat die Post Revisions standardm&#228;&#223;ig aktiviert. Dadurch sammeln sich viele Daten in der Datenbank. Wer es nicht ben&#246;tigt kann das ganz einfach abschalten. Und war muss einfach folgenden Codezeile in die "<strong>config.php</strong>" geschrieben werden.
</p>
<span id="more-37"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_POST_REVISIONS'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">False</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-post-revisions-deaktivieren/37/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Fehler bei deaktiviertem Plugin verhindern</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-fehler-bei-deaktiviertem-plugin-verhindern/36</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-fehler-bei-deaktiviertem-plugin-verhindern/36#comments</comments>
		<pubDate>Wed, 13 May 2009 09:02:48 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=36</guid>
		<description><![CDATA[Von Andreas Isaak Um h&#228;ssliche Fehlermeldungen bei deaktivierten Plugins zu verhindern, bindet man dessen Funktionen mit entsprechendem Code ein. Hier wird einfach abgefragt ob das Plugin vorhanden ist. Wenn ja wird es ausgef&#252;hrt wenn nicht kommt einfach nichts. 1 2 3 &#60;?php if &#40;function_exists&#40;'pluginname'&#41;&#41; &#123; pluginname&#40;&#41;; &#125; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>
Von Andreas Isaak<br /><br />
Um h&#228;ssliche Fehlermeldungen bei deaktivierten Plugins zu verhindern, bindet man dessen Funktionen mit entsprechendem Code ein. Hier wird einfach abgefragt ob das Plugin vorhanden ist. Wenn ja wird es ausgef&#252;hrt wenn nicht kommt einfach nichts.
</p>
<span id="more-36"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</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><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pluginname'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	pluginname<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></pre></td></tr></table></div>



]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-fehler-bei-deaktiviertem-plugin-verhindern/36/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Automatische Weiterleitung zu einer Unterseite</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-automatische-weiterleitung-zu-einer-unterseite/35</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-automatische-weiterleitung-zu-einer-unterseite/35#comments</comments>
		<pubDate>Wed, 13 May 2009 08:58:59 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Weiterleitung]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=35</guid>
		<description><![CDATA[Von Andreas Isaak Jedes normale CMS bietet den Service, ein Hauptmen&#252;punkt anzulegen der dann automatisch zum ersten Untermen&#252;punkt weiterleitet. Gerade dann sinnvoll wenn man keinen Inhalt f&#252;r den Hauptmen&#252;punkt hat aber er zur Erkl&#228;rung oben stehen sollten. Leider bietet WordPress hier keine interne L&#246;sung, daher habe ich mir ein eigenes kleines Script geschrieben was in [...]]]></description>
			<content:encoded><![CDATA[<p>
Von Andreas Isaak<br /><br />
Jedes normale CMS bietet den Service, ein Hauptmen&#252;punkt anzulegen der dann automatisch zum ersten Untermen&#252;punkt weiterleitet. Gerade dann sinnvoll wenn man keinen Inhalt f&#252;r den Hauptmen&#252;punkt hat aber er zur Erkl&#228;rung oben stehen sollten.
Leider bietet WordPress hier keine interne L&#246;sung, daher habe ich mir ein eigenes kleines Script geschrieben was in die erste Zeile der header.php geh&#246;rt (noch vor dem Doctype)!
</p>
<span id="more-35"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</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_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'beispielseite'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	wp_redirect<span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/beispielseite'</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></pre></td></tr></table></div>



]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-automatische-weiterleitung-zu-einer-unterseite/35/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

