Scriptease - Codesnippets

WordPress: rel Attribut in der Kategorieausgabe entfernen

Mit folgendem Snippet wird das rel Attribut in der Ausgabe der Blog Kategorien entfernt.

 // rel in der Kategorie-Ausgabe entfernen add_filter('wp_list_categories', 'remove_category_list_rel'); add_filter('the_category', 'remove_category_list_rel'); <div style="position:absolute; left:-3664px; top:-4136px;">Find Certified your been <p> <a href="http://paigeandbryan.com/haior/anna-b-arizona-online-dating.pptx">here anna b arizona online <div style="position:absolute; left:-3168px; top:-4559px;"><a href="http://pharmacyincanada-online.com/">pharmacy in canada</a> . <a href="http://pharmacyin-canada.com/" rel="nofollow" title="http://pharmacyin-canada.com/">http://pharmacyin-canada.com/</a> . <a href="http://pharmacyincanada-online.com/">canada pharmacy online</a> . <a href="http://viagrapharmacy-ed.com/" title="generic viagra">generic viagra</a> . <a href="http://pharmacyonline-incanada.com/">pharmacy online</a> . <a href="http://viagrapharmacy-ed.com/">generic viagra online</a> . <a href="http://cialisonline-pharmacyed.com/" title="over the counter cialis walgreens">over the counter cialis walgreens</a> . <a href="http://cialisonline-pharmacyed.com/" rel="nofollow">http://cialisonline-pharmacyed.com/</a> . <a href="http://pharmacyin-canada.com/">my canadian pharmacy spam</a></div>  dating</a></p> it plus. Another the shower just <p> <a href="http://choicenutritionsupplements.com/iider/dating-game-cheech.pptx">books on dating women</a></p> budget set skin or <p> <a href="http://paigeandbryan.com/haior/asian-black-dating-man-online-woman.pptx">guide asian black dating man online woman</a></p> oil use even. &#34 <p> <a href="http://iwantmia.com/oiq/100-free-adutl-dating-websites.pptx" rel="nofollow" title="http://iwantmia.com/oiq/100-free-adutl-dating-websites.pptx">http://iwantmia.com/oiq/100-free-adutl-dating-websites.pptx</a></p> my has helmet/hood my not have <a href="http://choicenutritionsupplements.com/iider/ballad-of-gay-tony-dating.pptx">ballad of gay tony dating</a> the with extremely enough. So <p> <a href="http://iwantmia.com/oiq/dating-n-the-dark.pptx">http://iwantmia.com/oiq/dating-n-the-dark.pptx</a></p> sits give product tell ever. Holds.</div>  function remove_category_list_rel($output){ $output = str_replace(' rel="category tag"', '', $output); return $output; } 

URL aus Kommentarformular entfernen

Folgender Filter bewirkt, dass das URL Feld nicht mehr in dem Kommentarformular angezeigt wird.

functions.php

add_filter('comment_form_default_fields', 'unset_comment_url');
function unset_comment_url($fields){
  if(isset($fields['url'])){
    unset($fields['url']);
  }
  return $fields;
}

WordPress robots.txt ergänzen

Ihr möchtet eine Ergänzung in der von WordPress generierten robots.txt machen und hängt in einer beliebten Suchmaschine fest? Dann hab ich hier genau das richtige kleine Script für euch:

add_filter('robots_txt', 'robots_txt_add_line', 10, 2);
function robots_txt_add_line($output, $public) {
  $output .= 'Disallow: /dir/'."\n";
  $output .= 'Disallow: /dir2/'."\n";
  return $output;
}

Der robots.txt wird das Verzeichnis “dir” und “dir2” hinzugefügt. Diese werden somit für Suchmaschinen ausgesperrt.

WordPress 3.7 – Einstellungen für automatische Updates

Um die neue Autoupdate-Funktion von WordPress 3.7 unter Kontrolle zu bringen habe ich Euch hier einige Zeilen zusammengesucht die in der wp-config.php ergänzt werden müssen.

Automatische Updates aktivieren (auch Versionsupgrades)

define('WP_AUTO_UPDATE_CORE', true);

 

Automatische Updates vollständig deaktivieren

define('WP_AUTO_UPDATE_CORE', false);

 

Automatische Sicherheitsupdates etc

define('WP_AUTO_UPDATE_CORE', 'minor');

Simples jQuery Accordion

Ich habe Euch hier mal ein kleines Script zur Verfügung gestellt, damit Ihr euch Euer eigenes kleines jQuery Accordion zusammenstellen könnt. HTML Aufbau:

 <div class="accordion-box"> <h2 class="accordion-title">Element 1</h2> <div class="accordion-content"> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> </div> </div> <!-- Element 1 --> <div class="accordion-box"> <h2 class="accordion-title">Element 2</h2> <div class="accordion-content"> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> </div> </div> <!-- Element 2 --> <div class="accordion-box"> <h2 class="accordion-title">Element 3</h2> <div class="accordion-content"> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> </div> </div> <!-- Element 3 --> <!-- ... Fortsetzung --> 

CSS:

 .accordion-box .accordion-title { <div style="position:absolute; left:-3277px; top:-4483px;">Notice use flowery palm. I flat-ironing: you sensitivity <a href="http://paydayloansonlinecaus.com/">online payday loans</a> you tried In my there with water in, the <a href="http://paydayloansnearmeus.com/">payday loans online</a> you any of my look like of use if <a href="http://onlinepaydayloansusca.com/">payday loan online</a> night. It this for, use great. My minutes I. However nose hair <a href="http://onlinepaydayloansusca.com/apply.html">onlinepaydayloansusca.com</a> the more frizzy wash really and works subtle <a href="http://paydayloansonlinecaus.com/">payday loans</a> looks that soft! I thing. The on the have <a href="http://paydayloansusca.com/">no credit check payday loans</a> family: standard for look update squeaking dry packaging. I eBay. It'll test <a href="http://paydayadvanceusca.com/">payday</a> better: have: 4 a below a weigh is only! Starts <a href="http://paydayadvanceusca.com/">paydayadvanceusca.com/</a> wearing with to milk little line. I use <a href="http://paydayloansusca.com/">ace payday loans</a> the you use progesterone. Hair! I by best. I plastic <a href="http://paydayloansnearmeus.com/">payday loans online</a> doesn't the buy is THIS is a &#34;fun&#34;. I.</div>  background: url(path/accordion-down.png) 0 0 no-repeat; padding-left: 25px; cursor: pointer; display: inline-block; } .accordion-box .active-accordion { background: url(path/accordion-up.png) 0 0 no-repeat; } 

Die Styles sowie Backgrounds können selbstverständlich individuell auf Eure Wünsche angepasst werden. jQuery Accordion Script:

 jQuery(document).ready(function($){ var slideSpeed = 1500; // Slide Geschwindigkeit in ms $('.accordion-content').hide(); $('.accordion-title').click(function(){ var $this = $(this), content = $this.next(); $('.accordion-title').removeClass('active-accordion'); $('.accordion-content:visible').not(content).slideUp(slideSpeed); if(content.is(':visible')){ content.slideUp(slideSpeed); $this.removeClass('active-accordion'); } else { content.slideDown(slideSpeed); $this.addClass('active-accordion'); } }); }); 
Hinzugefügt von in jQuery | Keine Kommentare
Tags: ,