<?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>Hiranthi&#039;s weblog &#187; Tutorials</title> <atom:link href="http://hiranthi.nl/category/tutorials/feed/" rel="self" type="application/rss+xml" /><link>http://hiranthi.nl</link> <description>Weblog van een ondernemende vrouw</description> <lastBuildDate>Fri, 20 Jan 2012 13:00:40 +0000</lastBuildDate> <language>nl</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Adresgegevens in de account opslaan</title><link>http://hiranthi.nl/tutorials/adresgegevens-in-de-account-opslaan/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adresgegevens-in-de-account-opslaan</link> <comments>http://hiranthi.nl/tutorials/adresgegevens-in-de-account-opslaan/#comments</comments> <pubDate>Tue, 17 Jan 2012 13:00:22 +0000</pubDate> <dc:creator>famire</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[Shopp]]></category><guid
isPermaLink="false">http://hiranthi.nl/?p=3363</guid> <description><![CDATA[Een opdrachtgever van me wilde graag geen adres-velden op de checkout, maar alleen op de account-pagina. Op zich was dat niet zo heel erg moeilijk, velden toevoegen aan account.php en verborgen input-velden met de adresgegevens in checkout.php (Shopp vereist namelijk wel een adres tijdens de checkout). Maar toen kwamen we achter een probleem: het wijzigen [...]]]></description> <content:encoded><![CDATA[<p>Een opdrachtgever van me wilde graag geen adres-velden op de checkout, maar alleen op de account-pagina. Op zich was dat niet zo heel erg moeilijk, velden toevoegen aan account.php en verborgen input-velden met de adresgegevens in checkout.php (Shopp vereist namelijk wel een adres tijdens de checkout).<span
id="more-3363"></span></p><p>Maar toen kwamen we achter een probleem: het wijzigen van de adresgegevens op de account-pagina werkt niet. Het wordt alleen opgeslagen als je op de checkout.php zit.<br
/>Zoeken in de Shopp forums hielp ook niet, daar bleek dat dit al sinds het begin zo is (en er erg veel mensen zijn die dit wel graag willen).</p><p>Het enige dat ik dacht was: &#8220;maar zo moeilijk kan het toch niet zijn?&#8221; En inderdaad: zo moeilijk was het ook niet <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p><h2>De code</h2><p>De volgende code zet je in de functions.php van je theme (of in een aparte plugin -&amp;gt; aangeraden!):</p><pre><pre class="brush: php; gutter: true">function save_address_info()
{
  global $Shopp;
  
  $Order =&amp; $Shopp-&gt;Order;
  
  if ( isset($_GET[&#039;acct&#039;]) &amp;&amp; ( $_GET[&#039;acct&#039;] == &#039;account&#039; ) )
  {
    if ( isset($_POST[&#039;billing&#039;]) &amp;&amp; isset($_POST[&#039;shipping&#039;]) )
    {
      // Shipping address
      $Order-&gt;Shipping-&gt;address  = $_POST[&#039;shipping&#039;][&#039;address&#039;];
      $Order-&gt;Shipping-&gt;xaddress  = $_POST[&#039;shipping&#039;][&#039;xaddress&#039;];
      $Order-&gt;Shipping-&gt;city    = $_POST[&#039;shipping&#039;][&#039;city&#039;];
      $Order-&gt;Shipping-&gt;state    = $_POST[&#039;shipping&#039;][&#039;state&#039;];
      $Order-&gt;Shipping-&gt;country  = $_POST[&#039;shipping&#039;][&#039;country&#039;];
      
      $Order-&gt;Shipping-&gt;save();
      
      // Billing address
      $Order-&gt;Billing-&gt;address  = $_POST[&#039;billing&#039;][&#039;address&#039;];
      $Order-&gt;Billing-&gt;xaddress  = $_POST[&#039;billing&#039;][&#039;xaddress&#039;];
      $Order-&gt;Billing-&gt;city    = $_POST[&#039;billing&#039;][&#039;city&#039;];
      $Order-&gt;Billing-&gt;state    = $_POST[&#039;billing&#039;][&#039;state&#039;];
      $Order-&gt;Billing-&gt;country  = $_POST[&#039;billing&#039;][&#039;country&#039;];
      
      $Order-&gt;Billing-&gt;save();
    }
  }
} // end save_address_info
add_action(&#039;shopp_init&#039;,&#039;save_address_info&#039;);</pre></pre><p>En je moet natuurlijk niet vergeten om de velden daadwerkelijk aan je account.php toe te voegen <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/adresgegevens-in-de-account-opslaan/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fadresgegevens-in-de-account-opslaan%2F&amp;t=Adresgegevens+in+de+account+opslaan" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Adresgegevens+in+de+account+opslaan%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D3363%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fadresgegevens-in-de-account-opslaan%2F&amp;title=Adresgegevens+in+de+account+opslaan&amp;notes=Een+opdrachtgever+van+me+wilde+graag+geen+adres-velden+op+de+checkout%2C+maar+alleen+op+de+account-pagina.+Op+zich+was+dat+niet+zo+heel+erg+moeilijk%2C+velden+toevoegen+aan+account.php+en+verborgen+input-velden+met+de+adresgegevens+in+checkout.php+%28Shopp" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fadresgegevens-in-de-account-opslaan%2F&amp;title=Adresgegevens+in+de+account+opslaan&amp;bodytext=Een+opdrachtgever+van+me+wilde+graag+geen+adres-velden+op+de+checkout%2C+maar+alleen+op+de+account-pagina.+Op+zich+was+dat+niet+zo+heel+erg+moeilijk%2C+velden+toevoegen+aan+account.php+en+verborgen+input-velden+met+de+adresgegevens+in+checkout.php+%28Shopp" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fadresgegevens-in-de-account-opslaan%2F&amp;title=Adresgegevens+in+de+account+opslaan" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/adresgegevens-in-de-account-opslaan/" onclick="addBookmark(event);" title="Adresgegevens in de account opslaan" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Adresgegevens in de account opslaan&amp;body=Een opdrachtgever van me wilde graag geen adres-velden op de checkout, maar alleen op de account-pagina. Op zich was dat niet zo heel erg moeilijk, velden toevoegen aan account.php en verborgen input-velden met de adresgegevens in checkout.php (Shopp - http://hiranthi.nl/tutorials/adresgegevens-in-de-account-opslaan/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/adresgegevens-in-de-account-opslaan/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Maatwerk product aan winkelwagen toevoegen</title><link>http://hiranthi.nl/tutorials/maatwerk-product-aan-winkelwagen-toevoegen/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=maatwerk-product-aan-winkelwagen-toevoegen</link> <comments>http://hiranthi.nl/tutorials/maatwerk-product-aan-winkelwagen-toevoegen/#comments</comments> <pubDate>Thu, 28 Jul 2011 09:06:55 +0000</pubDate> <dc:creator>famire</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[E-commerce]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Shopp]]></category> <category><![CDATA[webshop]]></category> <category><![CDATA[winkelwagen]]></category><guid
isPermaLink="false">http://hiranthi.nl/?p=3256</guid> <description><![CDATA[Het kan voorkomen dat je Shopp wilt gebruiken voor de afhandeling van de bestelling/betaling, maar dat je de daadwerkelijke producten niet (allemaal) als product wilt toevoegen. In zo&#8217;n geval is het natuurlijk handig om te weten hoe je producten via PHP in de winkelwagen krijgt. In dit deel van de &#8220;Shopp: maatwerk product in winkelwagen&#8221;-serie [...]]]></description> <content:encoded><![CDATA[<p>Het kan voorkomen dat je Shopp wilt gebruiken voor de afhandeling van de bestelling/betaling, maar dat je de daadwerkelijke producten niet (allemaal) als product wilt toevoegen. In zo&#8217;n geval is het natuurlijk handig om te weten hoe je producten via PHP in de winkelwagen krijgt.<span
id="more-3256"></span></p><p>In dit deel van de &#8220;Shopp: maatwerk product in winkelwagen&#8221;-serie laat ik zien hoe je met een eigen formulier een product aan de winkelwagen kan toevoegen. Met deze code kun je dan inhaken op andere plugins.</p><h2>Het formulier</h2><p>Als eerste maken we het formulier. Je kunt hier het beste een aparte pagina-template voor gebruiken.</p><pre><pre lang="php" class="brush: php; gutter: true">&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;ProductName&quot; value=&quot;Naam van Product&quot; &gt;
  &lt;input type=&quot;hidden&quot; name=&quot;ProductPrice&quot; value=&quot;10.00&quot; &gt;

  &lt;h2&gt;Naam van Product&lt;/h2&gt;

  &lt;big&gt;Prijs: &lt;php echo money(10.00); ?&gt;&lt;/big&gt;

  &lt;p&gt;&lt;label for=&quot;ProductQuantity&quot;&gt;Aantal&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;ProductQuantity&quot; id=&quot;ProductQuantity&quot; value=&quot;1&quot; /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;addtocart&quot; value=&quot;In winkelwagen&quot; /&gt;&lt;/p&gt;
&lt;/form&gt;</pre></pre><h3>Uitleg formulier code</h3><p>Zoals je kan zien is de <code>action</code> van dit formulier leeg, hierdoor wordt het formulier verzonden naar de huidige pagina. Vandaar de aparte pagina-template, je kunt de code voor het afhandelen van het verzonden formulier dan bij het formulier zelf houden.</p><pre><pre lang="html" class="brush: php; gutter: true">&lt;input type=&quot;hidden&quot; name=&quot;ProductName&quot; value=&quot;Naam van Product&quot; &gt;
  &lt;input type=&quot;hidden&quot; name=&quot;ProductPrice&quot; value=&quot;10.00&quot; &gt;</pre></pre><p>Deze verborgen velden zijn voor het opgeven van de benodigde gegevens, de naam en de prijs. De prijs wordt hier niet &#8220;op z&#8217;n Nederlands&#8221; neergezet, maar met een punt als scheiding tussen de decimalen en hele getallen. Dit om te verzekeren dat het bedrag juist wordt overgenomen als het product in de winkelwagen wordt gestopt.</p><pre lang="html" class="brush: php; gutter: true">&lt;h2&gt;Naam van Product&lt;/h2&gt;</pre><p>Dit lijkt me voor zich spreken. Je geeft de naam van het product wel mee in een verborgen veld, maar voor je bezoekers/klanten is het ook wel zo handig om te weten hoe het product heet.</p><pre lang="php" class="brush: php; gutter: true">&lt;big&gt;Prijs: &lt;php echo money(10.00); ?&gt;&lt;/big&gt;</pre><p>Je klanten willen natuurlijk ook wel graag weten wat een product dan kost, voor ze het in de winkelwagen stoppen. De <code>money()</code> functie is een Shopp-functie die ervoor zorgt dat de weergave van het bedrag overeenkomt met de valuta van je webshop. In Euro&#8217;s wordt dit dan <code>&amp;euro;10,00</code>.</p><pre lang="html" class="brush: php; gutter: true">&lt;p&gt;&lt;label for=&quot;ProductQuantity&quot;&gt;Aantal&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;ProductQuantity&quot; id=&quot;ProductQuantity&quot; value=&quot;1&quot; /&gt;&lt;/p&gt;</pre><p>Een invoerveld voor het aantal dat toegevoegd moet worden aan de winkelwagen. Hier kun je uiteraard ook een verborgen veld voor gebruiken waarmee je het aantal dat wordt toegevoegd vastzet.</p><pre lang="html" class="brush: php; gutter: true">&lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;addtocart&quot; value=&quot;In winkelwagen&quot; /&gt;&lt;/p&gt;</pre><p>De button die het formulier verzend.</p><h2>Aan winkelwagen toevoegen</h2><p>Met bovenstaande code heb je een leuk formuliertje, maar verder eigenlijk ook niet. We hebben nog code nodig die de verzonden gegevens gaan verwerken.</p><pre><pre lang="php" class="brush: php; gutter: true">&lt;?php

// is het formulier gepost?
if ( isset($_POST[&#039;addtocart&#039;]) )
{
  global $Shopp;
  $Order  =&amp;#038; ShoppOrder();
  $Cart  =&amp;#038; $Order-&gt;Cart;
  
  $Product          = new Product((time()-1));
  $NewProduct    = new Item($Product,time());

  $NewProduct-&gt;name  = esc_attr($_POST[&#039;ProductName&#039;]); // productnaam
  $NewProduct-&gt;unitprice  = intval($_POST[&#039;ProductPrice&#039;]); // de prijs per product
  $NewProduct-&gt;quantity  = intval($_POST[&#039;ProductQuantity&#039;]); // aantal van het product
  $NewProduct-&gt;taxrate  = shopp_taxrate(); // haal het BTW-percentage uit de Shopp instellingen
  $NewProduct-&gt;taxable  = true; // of het product met BTW belast moet worden of niet (true|false)

  $Cart-&gt;contents[]  = $NewProduct; // voeg het nieuwe product aan de winkelwagen toe
  $Cart-&gt;changed(true); // laat Shopp weten dat de winkelwagen is verandert
}

?&gt;</pre></pre><p>Shopp heeft ook een speciale functie om producten aan de winkelwagen toe te voegen, Adam heeft daar een voorbeeld van in <a
rel="nofollow" target="_blank" href="http://www.mygeeknc.com/shopp/programmatically-adding-items-to-shopps-cart/" title="Programmatically adding items to Shopp’s Cart">een van zijn tutorials</a>, maar ik vind deze manier zelf fijner. Zo heb je meer controle over waar het item in de winkelwagen geplaatst wordt.</p><h2>Custom data per product</h2><p>Wil je graag custom data toevoegen aan je product(en)? Dat kan uiteraard en dat doe je zo (moet boven <code>$Cart-&gt;contents[] = $NewProduct;</code> geplaatst worden):</p><pre><pre lang="php" class="brush: php; gutter: true">&lt;?php
  $NewProduct-&gt;data[&#039;Naam specifiek veld 1&#039;] = esc_attr($_POST[&#039;SpecificField1&#039;]);
  $NewProduct-&gt;data[&#039;Naam specifiek veld 2&#039;] = esc_attr($_POST[&#039;SpecificField2&#039;]);
?&gt;</pre></pre><p>Vergeet niet om de inputs voor deze velden ook toe te voegen aan het formulier (al dan niet met verborgen velden).</p><h2>Verwijderen uit winkelwagen</h2><p>Om het product uit de winkelwagen te verwijderen heb je geen extra code nodig, hier zorgt Shopp zelf voor.</p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/maatwerk-product-aan-winkelwagen-toevoegen/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fmaatwerk-product-aan-winkelwagen-toevoegen%2F&amp;t=Maatwerk+product+aan+winkelwagen+toevoegen" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Maatwerk+product+aan+winkelwagen+toevoegen%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D3256%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fmaatwerk-product-aan-winkelwagen-toevoegen%2F&amp;title=Maatwerk+product+aan+winkelwagen+toevoegen&amp;notes=Het+kan+voorkomen+dat+je+Shopp+wilt+gebruiken+voor+de+afhandeling+van+de+bestelling%2Fbetaling%2C+maar+dat+je+de+daadwerkelijke+producten+niet+%28allemaal%29+als+product+wilt+toevoegen.+In+zo%27n+geval+is+het+natuurlijk+handig+om+te+weten+hoe+je+producten+via+" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fmaatwerk-product-aan-winkelwagen-toevoegen%2F&amp;title=Maatwerk+product+aan+winkelwagen+toevoegen&amp;bodytext=Het+kan+voorkomen+dat+je+Shopp+wilt+gebruiken+voor+de+afhandeling+van+de+bestelling%2Fbetaling%2C+maar+dat+je+de+daadwerkelijke+producten+niet+%28allemaal%29+als+product+wilt+toevoegen.+In+zo%27n+geval+is+het+natuurlijk+handig+om+te+weten+hoe+je+producten+via+" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fmaatwerk-product-aan-winkelwagen-toevoegen%2F&amp;title=Maatwerk+product+aan+winkelwagen+toevoegen" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/maatwerk-product-aan-winkelwagen-toevoegen/" onclick="addBookmark(event);" title="Maatwerk product aan winkelwagen toevoegen" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Maatwerk product aan winkelwagen toevoegen&amp;body=Het kan voorkomen dat je Shopp wilt gebruiken voor de afhandeling van de bestelling/betaling, maar dat je de daadwerkelijke producten niet (allemaal) als product wilt toevoegen. In zo'n geval is het natuurlijk handig om te weten hoe je producten via  - http://hiranthi.nl/tutorials/maatwerk-product-aan-winkelwagen-toevoegen/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/maatwerk-product-aan-winkelwagen-toevoegen/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Elke taal een eigen sidebar</title><link>http://hiranthi.nl/tutorials/elke-taal-een-eigen-sidebar/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=elke-taal-een-eigen-sidebar</link> <comments>http://hiranthi.nl/tutorials/elke-taal-een-eigen-sidebar/#comments</comments> <pubDate>Wed, 18 May 2011 12:00:45 +0000</pubDate> <dc:creator>famire</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[sidebars]]></category> <category><![CDATA[vertalen]]></category> <category><![CDATA[WPML]]></category><guid
isPermaLink="false">http://hiranthi.nl/?p=2238</guid> <description><![CDATA[Als je WPML gebruikt in een WordPress website met sidebars, dan wil je die sidebars ook graag mee veranderen als de bezoeker een andere taal selecteert. Om dit te realiseren zul je voor elke taal een eigen sidebar aan moeten maken. Nou kun je natuurlijk de code daarvoor vast in de functions.php zetten, maar als [...]]]></description> <content:encoded><![CDATA[Als je <a
rel="nofollow" target="_blank" href="http://wpml.org/?aid=6111&#038;affiliate_key=CJoK2cWIFnRa" rel="affiliate external">WPML</a> gebruikt in een WordPress website met sidebars, dan wil je die sidebars ook graag mee veranderen als de bezoeker een andere taal selecteert. Om dit te realiseren zul je voor elke taal een eigen sidebar aan moeten maken.
Nou kun je natuurlijk de code daarvoor vast in de functions.php zetten, maar als jij (of je opdrachtgever etc.) op een later tijdstip besluit om een taal toe te voegen of te verwijderen, dan moet dit ook handmatig gebeuren.<h2>Dynamische sidebars per taal</h2> Het makkelijkst is dus om sidebars dynamisch aan te laten maken op basis van de talen die geactiveerd zijn. Dat doe je met de volgende code:<pre><pre class="brush: php; gutter: true;">&amp;amp;lt;?php

/*
 Register sidebars
*/
if ( function_exists(&#039;register_sidebars&#039;) )
{
    // WPML is active
    if ( function_exists(&#039;icl_get_languages&#039;) )
    {
        foreach ( icl_get_languages(&#039;skip_missing=0&amp;amp;orderby=name&amp;amp;order=asc&#039;) as $lang )
        {
            register_sidebar( array(
                &#039;name&#039;          =&amp;amp;gt; __(sprintf(&#039;%s Sidebar&#039;,strtoupper($lang[&#039;language_code&#039;]))),
                &#039;id&#039;            =&amp;amp;gt; &#039;sidebar-&#039;.$lang[&#039;language_code&#039;],
                &#039;before_widget&#039; =&amp;amp;gt; &#039;&amp;amp;lt;li id=&quot;%1$s&quot;&amp;amp;gt;&#039;,
                &#039;after_widget&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;/li&amp;amp;gt;&#039;,
                &#039;before_title&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;h4&amp;amp;gt;&#039;,
                &#039;after_title&#039;   =&amp;amp;gt; &#039;&amp;amp;lt;/h4&amp;amp;gt;&#039;
            ) );
        }
    }
    // WPML is not active
    else
    {
        register_sidebar( array(
            &#039;name&#039;          =&amp;amp;gt; __(&#039;Sidebar&#039;),
            &#039;id&#039;            =&amp;amp;gt; &#039;sidebar-default&#039;,
            &#039;before_widget&#039; =&amp;amp;gt; &#039;&amp;amp;lt;li id=&quot;%1$s&quot;&amp;amp;gt;&#039;,
            &#039;after_widget&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;/li&amp;amp;gt;&#039;,
            &#039;before_title&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;h4&amp;amp;gt;&#039;,
            &#039;after_title&#039;   =&amp;amp;gt; &#039;&amp;amp;lt;/h4&amp;amp;gt;&#039;
        ) );
    } // end if/else
} // end if

?&amp;amp;gt;</pre></pre> Met bovenstaande code zorg je ervoor dat er een standaard sidebar wordt aangemaakt als er geen talen actief zijn.<h2>Meerdere sidebars</h2> Gebruik je meerdere sidebars en wil je die allemaal vertalen? Dan herhaal je de code binnen in de <code>foreach</code> (de <code>register_sidebar</code> functie dus) en maak je de benodigde wijzigingen (naam &amp; ID van de sidebar).Een voorbeeldje van meerdere sidebars vertalen (een standaard sidebar en eentje voor de blogs):<pre><pre class="brush: php; gutter: true;">&amp;amp;lt;?php

/*
 Register sidebars
*/
if ( function_exists(&#039;register_sidebars&#039;) )
{
    // WPML is active
    if ( function_exists(&#039;icl_get_languages&#039;) )
    {
        foreach ( icl_get_languages(&#039;skip_missing=0&amp;amp;orderby=name&amp;amp;order=asc&#039;) as $lang )
        {
            register_sidebar( array(
                &#039;name&#039;          =&amp;amp;gt; __(sprintf(&#039;%s Sidebar | Default&#039;,strtoupper($lang[&#039;language_code&#039;]))),
                &#039;id&#039;            =&amp;amp;gt; &#039;sidebar-default-&#039;.$lang[&#039;language_code&#039;],
                &#039;before_widget&#039; =&amp;amp;gt; &#039;&amp;amp;lt;li id=&quot;%1$s&quot;&amp;amp;gt;&#039;,
                &#039;after_widget&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;/li&amp;amp;gt;&#039;,
                &#039;before_title&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;h4&amp;amp;gt;&#039;,
                &#039;after_title&#039;   =&amp;amp;gt; &#039;&amp;amp;lt;/h4&amp;amp;gt;&#039;
            ) );

            register_sidebar( array(
                &#039;name&#039;          =&amp;amp;gt; __(sprintf(&#039;%s Sidebar | Blog&#039;,strtoupper($lang[&#039;language_code&#039;]))),
                &#039;id&#039;            =&amp;amp;gt; &#039;sidebar-blog-&#039;.$lang[&#039;language_code&#039;],
                &#039;before_widget&#039; =&amp;amp;gt; &#039;&amp;amp;lt;li id=&quot;%1$s&quot;&amp;amp;gt;&#039;,
                &#039;after_widget&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;/li&amp;amp;gt;&#039;,
                &#039;before_title&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;h4&amp;amp;gt;&#039;,
                &#039;after_title&#039;   =&amp;amp;gt; &#039;&amp;amp;lt;/h4&amp;amp;gt;&#039;
            ) );
        }
    }
    // WPML is not active
    else
    {
        register_sidebar( array(
            &#039;name&#039;          =&amp;amp;gt; __(&#039;Sidebar | Default&#039;),
            &#039;id&#039;            =&amp;amp;gt; &#039;sidebar-default&#039;,
            &#039;before_widget&#039; =&amp;amp;gt; &#039;&amp;amp;lt;li id=&quot;%1$s&quot;&amp;amp;gt;&#039;,
            &#039;after_widget&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;/li&amp;amp;gt;&#039;,
            &#039;before_title&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;h4&amp;amp;gt;&#039;,
            &#039;after_title&#039;   =&amp;amp;gt; &#039;&amp;amp;lt;/h4&amp;amp;gt;&#039;
        ) );

        register_sidebar( array(
            &#039;name&#039;          =&amp;amp;gt; __(&#039;Sidebar | Blog&#039;),
            &#039;id&#039;            =&amp;amp;gt; &#039;sidebar-blog&#039;,
            &#039;before_widget&#039; =&amp;amp;gt; &#039;&amp;amp;lt;li id=&quot;%1$s&quot;&amp;amp;gt;&#039;,
            &#039;after_widget&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;/li&amp;amp;gt;&#039;,
            &#039;before_title&#039;  =&amp;amp;gt; &#039;&amp;amp;lt;h4&amp;amp;gt;&#039;,
            &#039;after_title&#039;   =&amp;amp;gt; &#039;&amp;amp;lt;/h4&amp;amp;gt;&#039;
        ) );
    } // end if/else
} // end if

?&amp;amp;gt;</pre></pre><h2>Sidebar laden</h2> Nou heb je natuurlijk niet zo heel veel aan vertaalde sidebars als je niet ook de juiste sidebar kan laden op de site. Open je sidebar.php en vervang de huidige code om de dynamische sidebar op te halen met de volgende code:<pre><pre class="brush: php; gutter: true;">&amp;amp;lt;?php

if ( function_exists(&#039;dynamic_sidebar&#039;) )
{
    // WPML is active
    if ( function_exists(&#039;icl_get_languages&#039;) )
    {
        // only load sidebar if it is active
        if ( is_active_sidebar(&#039;sidebar-&#039;.ICL_LANGUAGE_CODE) ) dynamic_sidebar(&#039;sidebar-&#039;.ICL_LANGUAGE_CODE);
    }
    // WPML is not active
    else
    {
        dynamic_sidebar(&#039;sidebar-default&#039;);
    }
}

?&amp;amp;gt;</pre></pre><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/elke-taal-een-eigen-sidebar/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Felke-taal-een-eigen-sidebar%2F&amp;t=Elke+taal+een+eigen+sidebar" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Elke+taal+een+eigen+sidebar%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D2238%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Felke-taal-een-eigen-sidebar%2F&amp;title=Elke+taal+een+eigen+sidebar&amp;notes=Als+je+WPML+gebruikt+in+een+WordPress+website+met+sidebars%2C+dan+wil+je+die+sidebars+ook+graag+mee+veranderen+als+de+bezoeker+een+andere+taal+selecteert.+Om+dit+te+realiseren+zul+je+voor+elke+taal+een+eigen+sidebar+aan+moeten+maken.%0D%0ANou+kun+je+natuur" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Felke-taal-een-eigen-sidebar%2F&amp;title=Elke+taal+een+eigen+sidebar&amp;bodytext=Als+je+WPML+gebruikt+in+een+WordPress+website+met+sidebars%2C+dan+wil+je+die+sidebars+ook+graag+mee+veranderen+als+de+bezoeker+een+andere+taal+selecteert.+Om+dit+te+realiseren+zul+je+voor+elke+taal+een+eigen+sidebar+aan+moeten+maken.%0D%0ANou+kun+je+natuur" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Felke-taal-een-eigen-sidebar%2F&amp;title=Elke+taal+een+eigen+sidebar" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/elke-taal-een-eigen-sidebar/" onclick="addBookmark(event);" title="Elke taal een eigen sidebar" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Elke taal een eigen sidebar&amp;body=Als je WPML gebruikt in een WordPress website met sidebars, dan wil je die sidebars ook graag mee veranderen als de bezoeker een andere taal selecteert. Om dit te realiseren zul je voor elke taal een eigen sidebar aan moeten maken.
Nou kun je natuur - http://hiranthi.nl/tutorials/elke-taal-een-eigen-sidebar/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/elke-taal-een-eigen-sidebar/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Huidige taal aan body_class toevoegen</title><link>http://hiranthi.nl/tutorials/huidige-taal-aan-body_class-toevoegen/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=huidige-taal-aan-body_class-toevoegen</link> <comments>http://hiranthi.nl/tutorials/huidige-taal-aan-body_class-toevoegen/#comments</comments> <pubDate>Wed, 11 May 2011 12:00:31 +0000</pubDate> <dc:creator>famire</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[body_class]]></category> <category><![CDATA[WPML]]></category><guid
isPermaLink="false">http://hiranthi.nl/?p=2231</guid> <description><![CDATA[Wil jij, net als Karin Bronwasser, graag de huidige taal van WPML aan de body_class toevoegen? Voeg dan de volgende code toe aan je functions.php: /*  * Desc: add current language to the body_class  */ function language_body_class($classes) {     if ( function_exists(&#039;icl_get_languages&#039;) )         $classes[] = &#039;lang-&#039;.ICL_LANGUAGE_CODE;     return $classes; } // end language_body_class [...]]]></description> <content:encoded><![CDATA[<p>Wil jij, net als <a
rel="nofollow" target="_blank" href="http://twitter.com/#%21/KarinBron/statuses/68249333228773376" target="_blank">Karin Bronwasser</a>, graag de huidige taal van <a
rel="nofollow" target="_blank" href="http://wpml.org/?aid=6111&#038;affiliate_key=CJoK2cWIFnRa" rel="affiliate external">WPML</a> aan de body_class toevoegen? Voeg dan de volgende code toe aan je functions.php:<span
id="more-2231"></span></p><pre><pre class="brush: php; gutter: true;">/*
 * Desc: add current language to the body_class
 */
function language_body_class($classes)
{
    if ( function_exists(&#039;icl_get_languages&#039;) )
        $classes[] = &#039;lang-&#039;.ICL_LANGUAGE_CODE;

    return $classes;
} // end language_body_class
add_filter(&#039;body_class&#039;,&#039;language_body_class&#039;);</pre></pre><p>Bovenstaande code voegt een class lang-XX toe aan de body-tag. Het XX staat dan voor de taalcode van de huidige taal (bijv. nl voor Nederlands, en voor Engels etc.).</p><h2>Waar kan ik dit voor gebruiken?</h2><p>Hiermee kun je gemakkelijk via CSS de stijling voor bepaalde talen aanpassen. Bijvoorbeeld de achtergrond-afbeelding anders maken per taal, of wat je maar wil veranderen in de CSS (op taal-basis) <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/huidige-taal-aan-body_class-toevoegen/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fhuidige-taal-aan-body_class-toevoegen%2F&amp;t=Huidige+taal+aan+body_class+toevoegen" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Huidige+taal+aan+body_class+toevoegen%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D2231%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fhuidige-taal-aan-body_class-toevoegen%2F&amp;title=Huidige+taal+aan+body_class+toevoegen&amp;notes=Wil+jij%2C+net+als+Karin+Bronwasser%2C+graag+de+huidige+taal+van+WPML+aan+de+body_class+toevoegen%3F+Voeg+dan+de+volgende+code+toe+aan+je+functions.php%3A%0D%0A%2F%2A%0D%0A%C2%A0%2A+Desc%3A+add+current+language+to+the+body_class%0D%0A%C2%A0%2A%2F%0D%0Afunction+language_body_class%28%24classes%29%0D%0A%7B%0D" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fhuidige-taal-aan-body_class-toevoegen%2F&amp;title=Huidige+taal+aan+body_class+toevoegen&amp;bodytext=Wil+jij%2C+net+als+Karin+Bronwasser%2C+graag+de+huidige+taal+van+WPML+aan+de+body_class+toevoegen%3F+Voeg+dan+de+volgende+code+toe+aan+je+functions.php%3A%0D%0A%2F%2A%0D%0A%C2%A0%2A+Desc%3A+add+current+language+to+the+body_class%0D%0A%C2%A0%2A%2F%0D%0Afunction+language_body_class%28%24classes%29%0D%0A%7B%0D" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fhuidige-taal-aan-body_class-toevoegen%2F&amp;title=Huidige+taal+aan+body_class+toevoegen" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/huidige-taal-aan-body_class-toevoegen/" onclick="addBookmark(event);" title="Huidige taal aan body_class toevoegen" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Huidige taal aan body_class toevoegen&amp;body=Wil jij, net als Karin Bronwasser, graag de huidige taal van WPML aan de body_class toevoegen? Voeg dan de volgende code toe aan je functions.php:
/*
 * Desc: add current language to the body_class
 */
function language_body_class($classes)
{
 - http://hiranthi.nl/tutorials/huidige-taal-aan-body_class-toevoegen/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/huidige-taal-aan-body_class-toevoegen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Dropdown navigatie 2.0 in WordPress</title><link>http://hiranthi.nl/tutorials/dropdown-navigatie-2-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dropdown-navigatie-2-wordpress</link> <comments>http://hiranthi.nl/tutorials/dropdown-navigatie-2-wordpress/#comments</comments> <pubDate>Mon, 14 Feb 2011 13:00:48 +0000</pubDate> <dc:creator>hiranthi</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[big menu]]></category> <category><![CDATA[css]]></category> <category><![CDATA[dropdown]]></category> <category><![CDATA[navigatie]]></category> <category><![CDATA[walker]]></category> <category><![CDATA[wp_nav_menu]]></category><guid
isPermaLink="false">http://www.hiranthi.nl/?p=1984</guid> <description><![CDATA[Sander vroeg me in mijn post of er ook ergens een tutorial was voor zo&#8217;n soort menu in WordPress. Ik weet dat Remkus ermee bezig is, maar heb er nog geen tutorial over gezien. Omdat ik zelf al een post had geschreven over de navigatie en HTML/CSS leek het me wel handig om ook een [...]]]></description> <content:encoded><![CDATA[<p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/tutorials/dropdown-navigatie-2/1522.html#comment-404" class="broken_link">Sander</a> vroeg me in mijn <a
href="http://hiranthi.nl/tutorials/dropdown-navigatie-2/">Dropdown navigatie 2.0</a> post of er ook ergens een tutorial was voor zo&#8217;n soort menu in WordPress. Ik weet dat Remkus ermee bezig is, maar heb er nog geen tutorial over gezien.<span
id="more-1984"></span><br
/> Omdat ik zelf al een post had geschreven over de navigatie en HTML/CSS leek het me wel handig om ook een vervolg erop te schrijven: hoe dit toe te voegen aan WordPress <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h2>Type menu</h2><p>Het soort menu dat we gaan gebruiken is de <code>[wp]wp_nav_menu[/wp]</code>, met andere woorden: het type menu dat je makkelijk kunt aanmaken/aanpassen via Weergave -&amp;gt; Menu&#8217;s (mits je theme dit ondersteund).</p><h2>Menu aanmaken</h2><p>Als je er zeker van bent dat je theme deze menu&#8217;s ondersteund kun je een nieuw menu aanmaken. Als je al een menu hebt kun je die ook gebruiken natuurlijk.</p><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/menu-toevoegen1.png" class="lightbox" ><img
class="aligncenter size-large wp-image-2059" src="/files/2011/02/menu-toevoegen1-618x200.png" alt="" width="618" height="200" /></a></p><p>Als je het menu hebt aangemaakt moet deze gekoppeld worden aan een thema locatie. Ik gebruik de theme Twenty Ten op mijn dev-installatie, deze heeft maar 1 thema-locatie.</p><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/thema-locatie1.png" class="lightbox" ><img
class="aligncenter size-large wp-image-2061" src="/files/2011/02/thema-locatie1-618x200.png" alt="" width="618" height="200" /></a></p><h3>Menu items aanmaken</h3><p>Als het menu is opgeslagen en gekoppeld aan een thema locatie kunnen we beginnen met items toevoegen aan het menu. Ik heb in dit geval de pagina&#8217;s About, Shop, Cart, Checkout en Your Account toegevoegd.</p><h3>Schermopties aanpassen</h3><p>Wat je zo op het eerste gezicht niet ziet is dat de menu mogelijkheden in WordPress nog leuker zijn dan ze zo al lijken <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Als je bovenin op schermopties klikt krijg je onderstaande onderdelen te zien. Vink CSS classes en Beschrijving aan.</p><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/schermopties1.png" class="lightbox" ><img
class="aligncenter size-large wp-image-2060" src="/files/2011/02/schermopties1-618x200.png" alt="" width="618" height="200" /></a></p><p>Na het aanvinken van deze twee eigenschappen krijg je twee extra invulvelden bij de menu-items (klik op een item om deze uit te klappen):</p><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/menu-item.png" class="lightbox" ><img
class="aligncenter size-large wp-image-2058" src="/files/2011/02/menu-item1-618x200.png" alt="" width="618" height="200" /></a></p><p>Je kunt nu dus een CSS class en beschrijving voor dat specifieke menu-item opgeven. Hier onder kun je zien wat ik heb ingevuld voor het menu-item Cart:</p><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/cart.png" class="lightbox" ><img
class="aligncenter size-large wp-image-2057" src="/files/2011/02/cart1-618x200.png" alt="" width="618" height="200" /></a></p><p>Vul de velden in voor alle menu-items (waar nodig/gewenst).</p><h2>Weergave menu</h2><p>Op dit moment hebben we een standaard uitklapmenu, mits de CSS in je theme dit ondersteund. Er is nog niks bijzonders aan en de extra informatie is nog niet te zien.</p><p>Om die info weer te geven maken we gebruik van de <code>$walker</code> die <code>[wp]wp_nav_menu[/wp]</code> heeft.</p><p>Open je <code>header.php</code> en zoek de code waarmee het menu wordt toegevoegd. In TwentyTen is dat de volgende regel:</p><pre lang="php">&lt;?php wp_nav_menu( array( &#039;container_class&#039; =&gt; &#039;menu-header&#039;, &#039;theme_location&#039; =&gt; &#039;primary&#039; ) ); ?&gt;</pre><p>Vervang dat met de volgende regel:</p><pre><pre lang="php">&lt;?php
    $walker = new My_Walker_Nav_Menu;
    wp_nav_menu( array( &#039;container_class&#039; =&gt; &#039;menu-header&#039;, &#039;theme_location&#039; =&gt; &#039;primary&#039;, &#039;walker&#039; =&gt; $walker ) );
?&gt;</pre></pre><p><em>Als je geen custom theme gebruikt/aan het maken bent kun je het beste gebruik maken van een <a
rel="nofollow" target="_blank" href="http://wpdimensie.nl/tips-en-trucs/twenty-ten-aanpassen-op-de-juiste-manier.htm">child theme</a>, maar daar ga ik nu verder niet op in.</em></p><h3>De walker aanmaken</h3><p>Om de walker te kunnen gebruiken voor het customizen van de menu-weergave moeten we deze ook aanmaken natuurlijk. Voeg de volgende code toe aan de <code>functions.php</code> van je theme (heb je die niet, maak het bestand dan aan):</p><pre><pre lang="php">&lt;?php
class My_Walker_Nav_Menu extends Walker_Nav_Menu
{
    function end_el(&amp;$output, $item, $depth)
    {
    $output .= &quot;&lt;/li&gt;\n&quot;;
    } // end end_el

    function start_lvl(&amp;$output, $depth)
    {
        $indent = str_repeat(&quot;t&quot;, $depth);
        
        $level = $depth+1;
        $output .= &quot;n$indent&lt;ul class=&quot;children level-$level&quot;&gt;n&quot;; // add level-X as a class for complex CSS possibilities
    } // end start_lvl

    function end_lvl(&amp;$output, $depth)
    {
        $indent = str_repeat(&quot;t&quot;, $depth);
        $output .= &quot;$indent&lt;/ul&gt;\n&quot;;
    } // end end_lvl

    function start_el(&amp;$output, $item, $depth, $args)
    {
        global $wp_query;
        
        $indent = ( $depth ) ? str_repeat( &quot;t&quot;, $depth ) : &#039;&#039;;

        $class_names = $value = &#039;&#039;;

        $classes = empty( $item-&gt;classes ) ? array() : (array) $item-&gt;classes;
        $classes[] = &#039;menu-item-&#039; . $item-&gt;ID;

        $class_names = join( &#039; &#039;, apply_filters( &#039;nav_menu_css_class&#039;, array_filter( $classes ), $item ) );
        $class_names = &#039; class=&quot;&#039; . esc_attr( $class_names ) . &#039;&quot;&#039;;

        $id = apply_filters( &#039;nav_menu_item_id&#039;, &#039;menu-item-&#039;. $item-&gt;ID, $item, $args );
        $id = strlen( $id ) ? &#039; id=&quot;&#039; . esc_attr( $id ) . &#039;&quot;&#039; : &#039;&#039;;

        $output .= $indent . &#039;&lt;li&#039; . $id . $value . $class_names .&#039;&gt;&#039;;
        
        $attributes  = ! empty( $item-&gt;attr_title ) ? &#039; title=&quot;&#039;  . esc_attr( $item-&gt;attr_title ) .&#039;&quot;&#039; : &#039;&#039;;
        $attributes .= ! empty( $item-&gt;target )     ? &#039; target=&quot;&#039; . esc_attr( $item-&gt;target     ) .&#039;&quot;&#039; : &#039;&#039;;
        $attributes .= ! empty( $item-&gt;xfn )        ? &#039; rel=&quot;&#039;    . esc_attr( $item-&gt;xfn        ) .&#039;&quot;&#039; : &#039;&#039;;
        $attributes .= ! empty( $item-&gt;url )        ? &#039; href=&quot;&#039;   . esc_attr( $item-&gt;url        ) .&#039;&quot;&#039; : &#039;&#039;;

        $item_output = $args-&gt;before;
        $item_output .= &#039;&lt;a&#039;. $attributes .&#039;&gt;&#039;;
        $item_output .= $args-&gt;link_before . apply_filters( &#039;the_title&#039;, $item-&gt;title, $item-&gt;ID ) . $args-&gt;link_after;
        $item_output .= &#039;&lt;/a&gt;&#039;;
        
        // only display the description if we&#039;re not in the toplevel
        if ( $depth != 0 )
        {
          $item_output .= &#039;&lt;div class=&quot;desc&quot;&gt;&#039; . $item-&gt;description . &#039;&lt;/div&gt;&#039;;
        }
        
        $item_output .= $args-&gt;after;

        $output .= apply_filters( &#039;walker_nav_menu_start_el&#039;, $item_output, $item, $depth, $args );
    } // end start_el
} // end class My_Walker_Nav_Menu
?&gt;</pre></pre><p>Er is niet zo heel veel anders, ten opzichte van de default walker. Ik heb twee dingen toegevoegd:</p><pre><pre lang="php">&lt;?php
        $output .= &quot;n$indent
&lt;ul class=&quot;children level-$level&quot;&gt;n&quot;; // add level-X as a class for complex CSS possibilities
?&gt;</pre></pre><p><em>level-X class toegevoegd, waarbij X het niveau is van het submenu, dit geeft je meer mogelijkheden met CSS.</em></p><pre><pre lang="php">&lt;?php
        // only display the description if we&#039;re not in the toplevel
        if ( $depth != 0 )
        {
          $item_output .= &#039;
&lt;div class=&quot;desc&quot;&gt;&#039; . $item-&gt;description . &#039;&lt;/div&gt;

&#039;;
        }
?&gt;</pre></pre><p><em>De beschrijving van het item alleen weergeven als we niet in het hoogste niveau van het menu zitten.</em></p><h2>Stijling</h2><p>Als je nu de site ververst zul je zien dat het menu er nog niet helemaal geweldig uitziet, dit gaan we aanpassen met CSS. Onderstaande CSS heb ik gekopieerd uit mijn <a
href="http://hiranthi.nl/tutorials/dropdown-navigatie-2/">Dropdown navigatie 2.0</a> tutorial.</p><pre><pre lang="css">
/* dropdown 2.0 */
ul#menu-2-0-navigatie li:hover { background:url(&#039;arrow-top.png&#039;) 10px 30px no-repeat; }
ul#menu-2-0-navigatie li a { color:#bbb; font-weight:bold; }
/* subitems - default */
ul#menu-2-0-navigatie li ul { display:none; position:absolute; top:35px; left:0; width:190px; background-color:#fff; border:1px solid #bbb; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; padding:5px; -moz-box-shadow: 0 0 .5em #bbb; -webkit-box-shadow: 0 0 .5em #bbb; box-shadow: 0 0 .5em #bbb; /* &gt;= IE8 */ }
ul#menu-2-0-navigatie li:hover ul { display:block; }
ul#menu-2-0-navigatie li ul li { padding:5px; display: block; line-height:normal; height:auto; border-bottom: 1px dotted #bbb; }
ul#menu-2-0-navigatie li ul li:last-child { border: 0; }
ul#menu-2-0-navigatie li ul li a,
ul#menu-2-0-navigatie li ul li:hover a { display:block; background: none; color: #000; }
ul#menu-2-0-navigatie li ul li a { padding: 5px 0;  }
ul#menu-2-0-navigatie li ul li a:hover { text-decoration:underline; }
ul#menu-2-0-navigatie li ul li .desc { font-style: italic; font-family: serif; }
ul#menu-2-0-navigatie li ul li ul { border:0; position:inherit; top:0; box-shadow:0 0 0; -moz-box-shadow:0 0 0; -webkit-box-shadow:0 0 0; border-radius:0; -moz-border-radius:0; -webkit-border-radius:0; }
</pre></pre><p><em>Bovenstaande CSS is voor het menu in TwentyTen, gebruik jij een ander theme? Pas dan de CSS aan aan de ID/classname van je menu. Gebruik voor zulke specifieke CSS (voor een specifiek item) liever niet de standaard <code>.menu</code> class die WP meegeeft.</em></p><p>Met bovenstaande CSS krijg je het volgende resultaat in TwentyTen, nog steeds een redelijk &#8216;basic&#8217; uitklapmenu:</p><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/menu-desc1.png" class="lightbox" ><img
src="/files/2011/02/menu-desc1-618x200.png" alt="" width="618" height="200" class="aligncenter size-large wp-image-2069" /></a></p><h3>Customizen</h3><p>Nu is het tijd om de item-specifieke CSS toe te gaan voegen. In mijn geval gaat het om de items met de volgende classes: <code>.cart</code>, <code>.checkout</code> en <code>orders</code>.</p><pre><pre lang="css">
body ul#menu-2-0-navigatie .cart,
body ul#menu-2-0-navigatie .checkout,
body ul#menu-2-0-navigatie .orders {
  padding-left: 40px;
  min-width: 140px;
  min-height: 32px;
}
ul#menu-2-0-navigatie .cart,
ul#menu-2-0-navigatie .cart:hover { background: url(&#039;images/shopping_cart.png&#039;) 0 7px no-repeat; }
ul#menu-2-0-navigatie .checkout,
ul#menu-2-0-navigatie .checkout:hover { background: url(&#039;images/next.png&#039;) 0 7px no-repeat; }
ul#menu-2-0-navigatie .orders,
ul#menu-2-0-navigatie .orders:hover { background: url(&#039;images/user.png&#039;) 0 7px no-repeat; }

body ul#menu-2-0-navigatie .cart a,
body ul#menu-2-0-navigatie .checkout a,
body ul#menu-2-0-navigatie .orders a {
  width: 145px;
}
</pre></pre><p><a
rel="nofollow" target="_blank" href="http://hiranthi.nl/files/2011/02/menu-styled1.png" class="lightbox" ><img
src="/files/2011/02/menu-styled1-618x200.png" alt="" width="618" height="200" class="aligncenter size-large wp-image-2070" /></a></p><p><em>De icons die ik gebruikt heb komen uit het <a
rel="nofollow" target="_blank" href="http://dryicons.com/free-icons/preview/iconika-red-icons/">Iconika Red</a> pakket van DryIcons.com</em></p><h2>Veel meer mogelijk</h2><p>Er zijn nog veel meer dingen mogelijk met de <code>[wp]wp_nav_menu[/wp]</code> en ook de stijling. Vandaar dat ik besloten heb om hier een serie aan toe te wijden.</p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/dropdown-navigatie-2-wordpress/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fdropdown-navigatie-2-wordpress%2F&amp;t=Dropdown+navigatie+2.0+in+WordPress" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Dropdown+navigatie+2.0+in+WordPress%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D1984%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fdropdown-navigatie-2-wordpress%2F&amp;title=Dropdown+navigatie+2.0+in+WordPress&amp;notes=Sander+vroeg+me+in+mijn++post+of+er+ook+ergens+een+tutorial+was+voor+zo%27n+soort+menu+in+WordPress.+Ik+weet+dat+Remkus+ermee+bezig+is%2C+maar+heb+er+nog+geen+tutorial+over+gezien.%0D%0A+Omdat+ik+zelf+al+een+post+had+geschreven+over+de+navigatie+en+HTML%2FCSS+" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fdropdown-navigatie-2-wordpress%2F&amp;title=Dropdown+navigatie+2.0+in+WordPress&amp;bodytext=Sander+vroeg+me+in+mijn++post+of+er+ook+ergens+een+tutorial+was+voor+zo%27n+soort+menu+in+WordPress.+Ik+weet+dat+Remkus+ermee+bezig+is%2C+maar+heb+er+nog+geen+tutorial+over+gezien.%0D%0A+Omdat+ik+zelf+al+een+post+had+geschreven+over+de+navigatie+en+HTML%2FCSS+" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fdropdown-navigatie-2-wordpress%2F&amp;title=Dropdown+navigatie+2.0+in+WordPress" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/dropdown-navigatie-2-wordpress/" onclick="addBookmark(event);" title="Dropdown navigatie 2.0 in WordPress" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Dropdown navigatie 2.0 in WordPress&amp;body=Sander vroeg me in mijn  post of er ook ergens een tutorial was voor zo'n soort menu in WordPress. Ik weet dat Remkus ermee bezig is, maar heb er nog geen tutorial over gezien.
Omdat ik zelf al een post had geschreven over de navigatie en HTML/CSS  - http://hiranthi.nl/tutorials/dropdown-navigatie-2-wordpress/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/dropdown-navigatie-2-wordpress/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Colorbox uitschakelen in Shopp</title><link>http://hiranthi.nl/shopp-faq/colorbox-uitschakelen-shopp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=colorbox-uitschakelen-shopp</link> <comments>http://hiranthi.nl/shopp-faq/colorbox-uitschakelen-shopp/#comments</comments> <pubDate>Fri, 03 Dec 2010 13:00:01 +0000</pubDate> <dc:creator>hiranthi</dc:creator> <category><![CDATA[Shopp FAQ]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[Colorbox]]></category> <category><![CDATA[E-commerce]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Shopp]]></category> <category><![CDATA[webshop]]></category> <category><![CDATA[zoom]]></category> <category><![CDATA[zoomfx]]></category><guid
isPermaLink="false">http://www.hiranthi.nl/?p=1980</guid> <description><![CDATA[Met Shopp kun je ook andere Lightbox-varianten gebruiken dan de standaard meegeleverde Colorbox (in het verleden was dat Thickbox), maar voor veel mensen is het niet duidelijk hoe je dat dan precies doet. Het is niet zo heel moeilijk, het enige dat je hoeft te doen is de volgende code aan je functions.php toevoegen: &#60;?php [...]]]></description> <content:encoded><![CDATA[<p>Met Shopp kun je ook andere Lightbox-varianten gebruiken dan de standaard meegeleverde Colorbox (in het verleden was dat Thickbox), maar voor veel mensen is het niet duidelijk hoe je dat dan precies doet.<span
id="more-1980"></span></p><p>Het is niet zo heel moeilijk, het enige dat je hoeft te doen is de volgende code aan je functions.php toevoegen:</p><pre><pre lang="php">&lt;?php
if ( is_plugin_active(&#039;shopp/Shopp.php&#039;) )
{
    shopp_deregister_script(&#039;colorbox&#039;); // het script niet meer laden
    wp_deregister_style(&#039;shopp.colorbox&#039;); // het css bestand is dan uiteraard ook niet meer nodig
}
?&gt;</pre></pre><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/shopp-faq/colorbox-uitschakelen-shopp/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Fshopp-faq%2Fcolorbox-uitschakelen-shopp%2F&amp;t=Colorbox+uitschakelen+in+Shopp" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Colorbox+uitschakelen+in+Shopp%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D1980%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Fshopp-faq%2Fcolorbox-uitschakelen-shopp%2F&amp;title=Colorbox+uitschakelen+in+Shopp&amp;notes=Met+Shopp+kun+je+ook+andere+Lightbox-varianten+gebruiken+dan+de+standaard+meegeleverde+Colorbox+%28in+het+verleden+was+dat+Thickbox%29%2C+maar+voor+veel+mensen+is+het+niet+duidelijk+hoe+je+dat+dan+precies+doet.%0AHet+is+niet+zo+heel+moeilijk%2C+het+enige+dat+j" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Fshopp-faq%2Fcolorbox-uitschakelen-shopp%2F&amp;title=Colorbox+uitschakelen+in+Shopp&amp;bodytext=Met+Shopp+kun+je+ook+andere+Lightbox-varianten+gebruiken+dan+de+standaard+meegeleverde+Colorbox+%28in+het+verleden+was+dat+Thickbox%29%2C+maar+voor+veel+mensen+is+het+niet+duidelijk+hoe+je+dat+dan+precies+doet.%0AHet+is+niet+zo+heel+moeilijk%2C+het+enige+dat+j" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Fshopp-faq%2Fcolorbox-uitschakelen-shopp%2F&amp;title=Colorbox+uitschakelen+in+Shopp" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/shopp-faq/colorbox-uitschakelen-shopp/" onclick="addBookmark(event);" title="Colorbox uitschakelen in Shopp" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Colorbox uitschakelen in Shopp&amp;body=Met Shopp kun je ook andere Lightbox-varianten gebruiken dan de standaard meegeleverde Colorbox (in het verleden was dat Thickbox), maar voor veel mensen is het niet duidelijk hoe je dat dan precies doet.
Het is niet zo heel moeilijk, het enige dat j - http://hiranthi.nl/shopp-faq/colorbox-uitschakelen-shopp/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/shopp-faq/colorbox-uitschakelen-shopp/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Voeg datum toe aan post inhoud</title><link>http://hiranthi.nl/tutorials/voeg-datum-toe-aan-post-inhoud/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=voeg-datum-toe-aan-post-inhoud</link> <comments>http://hiranthi.nl/tutorials/voeg-datum-toe-aan-post-inhoud/#comments</comments> <pubDate>Mon, 29 Nov 2010 13:00:39 +0000</pubDate> <dc:creator>hiranthi</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[datum]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[post]]></category><guid
isPermaLink="false">http://www.hiranthi.nl/?p=1959</guid> <description><![CDATA[Soms wil je graag de datum van een post toevoegen aan de inhoud van de post in plaats van in een eigen paragraaf erboven. Meestal omdat dit in die gevallen gewoon mooier staat. Een tijdje geleden wilde ik dit ook bij een klant en dit is de code dat ik ervoor gebruikt heb: &#60;?php add_filter( [...]]]></description> <content:encoded><![CDATA[<p>Soms wil je graag de datum van een post toevoegen aan de inhoud van de post in plaats van in een eigen paragraaf erboven. Meestal omdat dit in die gevallen gewoon mooier staat.<span
id="more-1959"></span></p><p>Een tijdje geleden wilde ik dit ook bij een klant en dit is de code dat ik ervoor gebruikt heb:</p><pre><pre lang="php">&lt;?php
add_filter( &quot;the_content&quot;, &quot;add_date_content&quot; );
function add_date_content ( $content )
{
  if (is_single())
  {
    $content = &#039;&lt;p&gt;&lt;span class=&quot;date&quot;&gt;&#039;.get_the_date(get_option(&#039;date_format&#039;)).&#039;&lt;/span&gt;&#039; . substr($content, 3);
  }  
  return $content;
}
?&gt;</pre></pre><p>De <code>substr</code> functie haalt de eerste drie chars weg, wat over het algemeen de <code>p</code> tag is. Vandaar dus ook de <code>p</code> tag voor de <code>span</code> voor de datum.</p><p>De <code>[wp]get_option[/wp](&#039;date_format&#039;)</code> functie zorgt ervoor dat de datum die wordt weergegeven het format gebruikt dat in de WordPress instellingen is opgegeven.</p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/voeg-datum-toe-aan-post-inhoud/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fvoeg-datum-toe-aan-post-inhoud%2F&amp;t=Voeg+datum+toe+aan+post+inhoud" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Voeg+datum+toe+aan+post+inhoud%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D1959%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fvoeg-datum-toe-aan-post-inhoud%2F&amp;title=Voeg+datum+toe+aan+post+inhoud&amp;notes=Soms+wil+je+graag+de+datum+van+een+post+toevoegen+aan+de+inhoud+van+de+post+in+plaats+van+in+een+eigen+paragraaf+erboven.+Meestal+omdat+dit+in+die+gevallen+gewoon+mooier+staat.%0A%0AEen+tijdje+geleden+wilde+ik+dit+ook+bij+een+klant+en+dit+is+de+code+dat+" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fvoeg-datum-toe-aan-post-inhoud%2F&amp;title=Voeg+datum+toe+aan+post+inhoud&amp;bodytext=Soms+wil+je+graag+de+datum+van+een+post+toevoegen+aan+de+inhoud+van+de+post+in+plaats+van+in+een+eigen+paragraaf+erboven.+Meestal+omdat+dit+in+die+gevallen+gewoon+mooier+staat.%0A%0AEen+tijdje+geleden+wilde+ik+dit+ook+bij+een+klant+en+dit+is+de+code+dat+" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fvoeg-datum-toe-aan-post-inhoud%2F&amp;title=Voeg+datum+toe+aan+post+inhoud" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/voeg-datum-toe-aan-post-inhoud/" onclick="addBookmark(event);" title="Voeg datum toe aan post inhoud" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Voeg datum toe aan post inhoud&amp;body=Soms wil je graag de datum van een post toevoegen aan de inhoud van de post in plaats van in een eigen paragraaf erboven. Meestal omdat dit in die gevallen gewoon mooier staat.Een tijdje geleden wilde ik dit ook bij een klant en dit is de code dat  - http://hiranthi.nl/tutorials/voeg-datum-toe-aan-post-inhoud/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/voeg-datum-toe-aan-post-inhoud/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Een WordPress plugin maken</title><link>http://hiranthi.nl/tutorials/wordpress-plugin-maken/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-plugin-maken</link> <comments>http://hiranthi.nl/tutorials/wordpress-plugin-maken/#comments</comments> <pubDate>Fri, 26 Nov 2010 13:00:24 +0000</pubDate> <dc:creator>hiranthi</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WordPress plugin]]></category><guid
isPermaLink="false">http://www.hiranthi.nl/?p=1532</guid> <description><![CDATA[Een WordPress plugin maken is helemaal niet moeilijk en dat ga ik je laten zien in deze post Gegevens plugin Eigenlijk is dit het enige dat je nodig hebt om een plugin te schrijven: &#60;?php /* Plugin Name: Name Of The Plugin Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates Description: A brief description of the Plugin. Version: The Plugin&#039;s [...]]]></description> <content:encoded><![CDATA[<p>Een WordPress plugin maken is helemaal niet moeilijk en dat ga ik je laten zien in deze post <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span
id="more-1532"></span></p><h2>Gegevens plugin</h2><p>Eigenlijk is dit het enige dat je nodig hebt om een plugin te schrijven:</p><pre><pre lang="php">&lt;?php
/*
Plugin Name: Name Of The Plugin
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: A brief description of the Plugin.
Version: The Plugin&#039;s Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
License: A &quot;Slug&quot; license name e.g. GPL2
*/
?&gt;
</pre></pre><p>Als je bovenstaande kopieert, in een <code>.php</code> bestand zet en upload in je plugins map kun je &#8216;m al kiezen bij de Plugins in je WordPress admin <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Als je deze plugin dan activeert zul je zien dat er helemaal niks gebeurd. Niet zo heel vreemd, want de plugin heeft totaal geen inhoud <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><h2>Extra informatie</h2><h3>Queries</h3><p>Als je een plugin gaat schrijven is het belangrijk dat je de code zo veilig mogelijk gebruikt, als je bijvoorbeeld gebruik maakt van de <code>&lt;a href=&quot;http://codex.wordpress.org/Function_Reference/wpdb_Class&quot;&gt;$wpdb&lt;/a&gt;</code> class vergeet dan niet om <a
rel="nofollow" target="_blank" href="http://codex.wordpress.org/Function_Reference/wpdb_Class#Protect_Queries_Against_SQL_Injection_Attacks">de query ook voor te bereiden</a>.</p><h3>Meertaligheid</h3><p>Naast je <a
href="http://hiranthi.nl/tutorials/wordpress-theme-vertaalbaar/">themes beschikbaar maken in meerdere talen</a> kun je ook je plugins &#8216;localizen&#8217;. Hoe je dat doet kun je in <a
href="http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/">deze post</a> lezen.</p><h2>De mogelijkheden</h2><p>De mogelijkheden die je hebt met plugins (lees: wat voor soort plugins je kan maken) zijn praktisch eindeloos. Dit is ook wel te zien in het aanbod dat reeds in de <a
rel="nofollow" target="_blank" href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> staat.</p><p>Vergeet niet dat je nog wel eens bedolven zou kunnen worden onder support-requests als je je plugin aan de WordPress Plugin Directory toevoegt (voor feature requests, bug reports etc.).</p><h2>Meer weten over plugins schrijven?</h2><p>Wil je meer weten over het schrijven van je eigen plugin? Dan kan ik je de volgende resources aanraden:</p><ul><li><a
rel="nofollow" target="_blank" href="http://codex.wordpress.org/Writing_a_Plugin">Writing a Plugin</a> &#8211; WordPress Codex</li><li><a
rel="nofollow" target="_blank" href="http://cnjcbs.com/speaking-wordcamp-netherlands-2010">Coen Jacobs zijn presentatie tijdens WordCampNL 2010</a> (over het schrijven van een plugin)</li><li><a
rel="nofollow" target="_blank" href="http://yoast.com/cat/wordpress/">Yoast</a> &#8211; op de website van Joost staan erg veel tips voor het schrijven van (o.a.) plugins</li><li><a
rel="nofollow" target="_blank" href="http://www.smashingmagazine.com/tag/wordpress/">Smashing Magazine</a> over WordPress</li><li><a
rel="nofollow" target="_blank" href="http://freelancefolder.com/13-great-sites-for-wordpress-tips-tutorials-and-hacks/">Deze post van Freelance Folder </a>met links naar 13 sites die over WordPress schrijven (o.a. tips etc)</li></ul><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/wordpress-plugin-maken/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-maken%2F&amp;t=Een+WordPress+plugin+maken" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Een+WordPress+plugin+maken%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D1532%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-maken%2F&amp;title=Een+WordPress+plugin+maken&amp;notes=Een+WordPress+plugin+maken+is+helemaal+niet+moeilijk+en+dat+ga+ik+je+laten+zien+in+deze+post+%3A%29%0AGegevens+plugin%0AEigenlijk+is+dit+het+enige+dat+je+nodig+hebt+om+een+plugin+te+schrijven%3A%0A" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-maken%2F&amp;title=Een+WordPress+plugin+maken&amp;bodytext=Een+WordPress+plugin+maken+is+helemaal+niet+moeilijk+en+dat+ga+ik+je+laten+zien+in+deze+post+%3A%29%0AGegevens+plugin%0AEigenlijk+is+dit+het+enige+dat+je+nodig+hebt+om+een+plugin+te+schrijven%3A%0A" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-maken%2F&amp;title=Een+WordPress+plugin+maken" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/wordpress-plugin-maken/" onclick="addBookmark(event);" title="Een WordPress plugin maken" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Een WordPress plugin maken&amp;body=Een WordPress plugin maken is helemaal niet moeilijk en dat ga ik je laten zien in deze post :)
Gegevens plugin
Eigenlijk is dit het enige dat je nodig hebt om een plugin te schrijven:
- http://hiranthi.nl/tutorials/wordpress-plugin-maken/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/wordpress-plugin-maken/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Je WordPress plugin vertaalbaar maken</title><link>http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-plugin-vertaalbaar</link> <comments>http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/#comments</comments> <pubDate>Wed, 24 Nov 2010 13:00:06 +0000</pubDate> <dc:creator>hiranthi</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[localize]]></category> <category><![CDATA[vertalen]]></category> <category><![CDATA[WordPress plugin]]></category><guid
isPermaLink="false">http://www.hiranthi.nl/?p=1582</guid> <description><![CDATA[Als je een WordPress plugin maakt &#8211; voor jezelf, een klant of om in de WordPress Repository op te nemen &#8211; dan is het wel zo handig om deze beschikbaar te maken in meerdere talen. Of in ieder geval andere gebruikers de gelegenheid te geven om jouw plugin makkelijk te gebruiken in hun eigen taal. [...]]]></description> <content:encoded><![CDATA[<p>Als je een WordPress plugin maakt &#8211; voor jezelf, een klant of om in de WordPress Repository op te nemen &#8211; dan is het wel zo handig om deze beschikbaar te maken in meerdere talen. Of in ieder geval andere gebruikers de gelegenheid te geven om jouw plugin makkelijk te gebruiken in hun eigen taal.<span
id="more-1582"></span></p><p>De manier van vertalen is hetzelfde als bij <a
href="http://hiranthi.nl/tutorials/wordpress-theme-vertaalbaar/">WordPress themes</a>, het enige verschil is de manier waarop je WordPress laat weten dat er vertaalmogelijkheden zijn en waar het bestand staat. Dit doe je met <code>[wp]load_plugin_textdomain[/wp]</code>:</p><pre lang="php">&lt;?php load_plugin_textdomain( $domain, $abs_rel_path, $plugin_rel_path ) ?&gt;</pre><h3>Uitleg functie</h3><ul><li><code>$domain</code> &#8211; een unieke identifier, bijvoorbeeld de mapnaam van je plugin (ie. mijn_plugin)</li><li><code>$abs_rel_path</code> &#8211; het relatieve pad (vanaf <code>ABSPATH</code> bekeken) naar de map waar het taalbestand in zit &#8211; werkt tot WP2.7</li><li><code>$plugin_rel_path</code> &#8211; het relatieve pad (vanaf <code>WP_PLUGIN_DIR</code>, de map waar alle plugins in staan). Deze dient vanaf WP2.7 gebruikt te worden.</li></ul><p>Een voorbeeld van de toepassing:</p><pre lang="php">&lt;?php load_plugin_textdomain( &#039;mijn_plugin&#039;, false, dirname( plugin_basename( __FILE__ ) ) ) ) ?&gt;</pre><p>Onderstaande code heeft de mapnaam van het huidige bestand als output en daarom wordt deze gebruikt als opgaaf voor de <code>$plugin_rel_path</code>.</p><pre lang="php">&lt;?php dirname( plugin_basename( __FILE__ ) ) ) ) ?&gt;</pre><h2>Het vertalen</h2><p>Het vertalen zelf doe je met een programma als <a
rel="nofollow" target="_blank" href="http://www.poedit.net">Poedit</a>. Hoe je deze gebruikt kun je lezen in mijn <a
href="http://hiranthi.nl/tutorials/poedit/">Poedit gebruiken</a> post.</p><h3>Vertaalbestand</h3><p>Het vertaalbestand moet als volgt genoemd worden: <code>$domain-{langcode}.mo</code>, wat bijvoorbeeld uitkomt op het volgende: <code>mijn_plugin-nl_NL.mo</code>.</p><p>Bij <code>$domain</code> gebruik je dus dezelfde unieke identifier als dat je hebt gebruikt om de te vertalen strings mee op te geven (en die je opgeeft in de <code>load_plugin_textdomain</code> functie).</p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-vertaalbaar%2F&amp;t=Je+WordPress+plugin+vertaalbaar+maken" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Je+WordPress+plugin+vertaalbaar+maken%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D1582%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-vertaalbaar%2F&amp;title=Je+WordPress+plugin+vertaalbaar+maken&amp;notes=Als+je+een+WordPress+plugin+maakt+-+voor+jezelf%2C+een+klant+of+om+in+de+WordPress+Repository+op+te+nemen+-+dan+is+het+wel+zo+handig+om+deze+beschikbaar+te+maken+in+meerdere+talen.+Of+in+ieder+geval+andere+gebruikers+de+gelegenheid+te+geven+om+jouw+plu" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-vertaalbaar%2F&amp;title=Je+WordPress+plugin+vertaalbaar+maken&amp;bodytext=Als+je+een+WordPress+plugin+maakt+-+voor+jezelf%2C+een+klant+of+om+in+de+WordPress+Repository+op+te+nemen+-+dan+is+het+wel+zo+handig+om+deze+beschikbaar+te+maken+in+meerdere+talen.+Of+in+ieder+geval+andere+gebruikers+de+gelegenheid+te+geven+om+jouw+plu" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwordpress-plugin-vertaalbaar%2F&amp;title=Je+WordPress+plugin+vertaalbaar+maken" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/" onclick="addBookmark(event);" title="Je WordPress plugin vertaalbaar maken" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Je WordPress plugin vertaalbaar maken&amp;body=Als je een WordPress plugin maakt - voor jezelf, een klant of om in de WordPress Repository op te nemen - dan is het wel zo handig om deze beschikbaar te maken in meerdere talen. Of in ieder geval andere gebruikers de gelegenheid te geven om jouw plu - http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/wordpress-plugin-vertaalbaar/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Winkelwagen in een Lightbox variant</title><link>http://hiranthi.nl/tutorials/winkelwagen-lightbox/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=winkelwagen-lightbox</link> <comments>http://hiranthi.nl/tutorials/winkelwagen-lightbox/#comments</comments> <pubDate>Thu, 04 Nov 2010 13:00:06 +0000</pubDate> <dc:creator>hiranthi</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[E-commerce]]></category> <category><![CDATA[Shopp]]></category> <category><![CDATA[shoppingcart]]></category> <category><![CDATA[webshop]]></category> <category><![CDATA[webwinkel]]></category> <category><![CDATA[winkelmandje]]></category> <category><![CDATA[winkelwagen]]></category><guid
isPermaLink="false">http://www.hiranthi.nl/?p=1543</guid> <description><![CDATA[Het ging niet zo lekker met deze post, maar hier dan toch de inhoud In deze post ga ik uitleggen hoe je je winkelwagen in een Lightbox variant kunt maken. Lightbox variant kiezen Allereerst moet je een Lightbox variant kiezen waar de winkelwagen in weergegeven wordt. Net als mijn maak ik nu gebruik van Shadowbox. [...]]]></description> <content:encoded><![CDATA[<p>Het ging niet zo lekker met deze post, maar hier dan toch de inhoud <img
src='http://hiranthi.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p>In deze post ga ik uitleggen hoe je je winkelwagen in een Lightbox variant kunt maken.<span
id="more-1543"></span></p><h2>Lightbox variant kiezen</h2><p>Allereerst moet je een Lightbox variant kiezen waar de winkelwagen in weergegeven wordt. Net als mijn <a
href="http://hiranthi.nl/tutorials/quick-preview-producten/">quick preview tutorial</a> maak ik nu gebruik van <a
rel="nofollow" target="_blank" href="http://www.shadowbox-js.com/">Shadowbox</a>.</p><h2>CODE</h2><p>Hier onder de CODE voor de winkelwagen, dit stop je in de <code>header.php</code> van je WordPress theme:</p><pre><pre lang="html">&lt;div id=&quot;cart&quot; style=&quot;display:none&quot;&gt;
&lt;?php include(&#039;shopp/sidecart.php&#039;) ?&gt;
&lt;/div&gt;</pre></pre><p>In bovenstaande code wordt de sidecart.php (template van Shopp) geïnclude, hiervoor is het dan wel nodig dat je custom templates hebt geactiveerd.</p><p>De stijling kun je het beste in een apart CSS bestand zetten (<code>shopp.css</code> of die van je theme bijvoorbeeld), maar voor dit voorbeeld zet ik het in de HTML.</p><h2>Links naar winkelwagen</h2><p>Je winkelwagen in een Lightbox variant neerzetten is dus niet zo heel moeilijk, je moet alleen niet vergeten ook de links naar de winkelwagen aan te passen op de Lightbox variant en hiervoor zul je de templates aan moeten passen. De links moeten er (bijvoorbeeld) zo uit te komen zien:</p><pre lang="html">&lt;a href=&quot;#cart&quot; rel=&quot;shadowbox;width=300;height=300&quot;&gt;Bekijk mijn winkelwagen&lt;/a&gt;</pre><h2>Stijling</h2><p>De weergave van de sidecart kun je uiteraard aanpassen met behulp van CSS, hou er in dit geval ook rekening mee dat je de stijling van de Lightbox variant eventueel aan moet passen.</p><h2>AJAX</h2><p>Het is natuurlijk het mooist als je AJAX gebruikt om de winkelwagen mee te updaten, dit zal ik in een volgende tutorial behandelen.</p><h2>Online demo</h2><p>Op mijn <a
rel="nofollow" target="_blank" href="http://demo.shopp.illutic-webdesign.nl/shop/">Shopp demo-website</a> heb ik hier een online demo van gemaakt, de link naar de winkelwagen heb ik in een tekstwidget in de sidebar gezet.</p><div
class="printfriendly alignleft"><a
href="http://hiranthi.nl/tutorials/winkelwagen-lightbox/?pfstyle=wp" rel="nofollow" ><img
src="//cdn.printfriendly.com/pf-print-icon.gif" alt="Print Friendly"/><span
class="printandpdf printfriendly-text"> Print <img
src="//cdn.printfriendly.com/pf-pdf-icon.gif" alt="Get a PDF version of this webpage" /> PDF </span></a></div><div
class="wp-socializer 16px"><ul
class="wp-socializer-jump columns-no"><li><a
href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwinkelwagen-lightbox%2F&amp;t=Winkelwagen+in+een+Lightbox+variant" title="Share this on Facebook" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Facebook" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -391px; border:0;"/></a></li><li><a
href="http://twitter.com/home?status=Winkelwagen+in+een+Lightbox+variant%20-%20http%3A%2F%2Fhiranthi.nl%3Fp%3D1543%20" title="Tweet this !" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Twitter" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1581px; border:0;"/></a></li><li><a
href="http://delicious.com/post?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwinkelwagen-lightbox%2F&amp;title=Winkelwagen+in+een+Lightbox+variant&amp;notes=Het+ging+niet+zo+lekker+met+deze+post%2C+maar+hier+dan+toch+de+inhoud+%3B%29%0A%0AIn+deze+post+ga+ik+uitleggen+hoe+je+je+winkelwagen+in+een+Lightbox+variant+kunt+maken.%0A%0ALightbox+variant+kiezen%0A%0AAllereerst+moet+je+een+Lightbox+variant+kiezen+waar+de+winkelwage" title="Post this on Delicious" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Delicious" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -221px; border:0;"/></a></li><li><a
href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwinkelwagen-lightbox%2F&amp;title=Winkelwagen+in+een+Lightbox+variant&amp;bodytext=Het+ging+niet+zo+lekker+met+deze+post%2C+maar+hier+dan+toch+de+inhoud+%3B%29%0A%0AIn+deze+post+ga+ik+uitleggen+hoe+je+je+winkelwagen+in+een+Lightbox+variant+kunt+maken.%0A%0ALightbox+variant+kiezen%0A%0AAllereerst+moet+je+een+Lightbox+variant+kiezen+waar+de+winkelwage" title="Submit this to Digg" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Digg" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -272px; border:0;"/></a></li><li><a
href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhiranthi.nl%2Ftutorials%2Fwinkelwagen-lightbox%2F&amp;title=Winkelwagen+in+een+Lightbox+variant" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="StumbleUpon" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1496px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/tutorials/winkelwagen-lightbox/" onclick="addBookmark(event);" title="Winkelwagen in een Lightbox variant" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Add to favorites" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li><li><a
href="mailto:info@illutic.nl?subject=Winkelwagen in een Lightbox variant&amp;body=Het ging niet zo lekker met deze post, maar hier dan toch de inhoud ;)In deze post ga ik uitleggen hoe je je winkelwagen in een Lightbox variant kunt maken.Lightbox variant kiezenAllereerst moet je een Lightbox variant kiezen waar de winkelwage - http://hiranthi.nl/tutorials/winkelwagen-lightbox/" title="Email this" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="Email" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -374px; border:0;"/></a></li><li><a
href="http://hiranthi.nl/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img
src="http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-16px.gif" alt="RSS" style="width:16px; height:16px; background: transparent url(http://hiranthi.famire.nl/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-16px.png) no-repeat; background-position:0px -1343px; border:0;"/></a></li></ul><div
class="wp-socializer-clearer"></div></div>]]></content:encoded> <wfw:commentRss>http://hiranthi.nl/tutorials/winkelwagen-lightbox/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic (User agent is rejected)
Content Delivery Network via Amazon Web Services: S3: cdn.hiranthi.nl.s3.amazonaws.com (user agent is rejected)

Served from: hiranthi.nl @ 2012-02-07 22:38:51 -->
