1. Auf "Verwalten -> Dateien" gehen, nach unten scrollen, auf "Site Style Sheet" klicken und warten, bis oben steht: "Editing wp-layout.css". Dort am Ende des Textbereichs die folgende Zeile einfügen:
#counter { width: 170px; color: white; background-color: #111; font-size: 1.2em; padding: 4px 0 4px 10px; }
Danach (wie auch nach jedem der folgenden Schritte) auf "Update" (bzw. "Speichern") klicken!
2. Auf "Verwalten -> Dateien" gehen, darauf achten, dass oben steht: "Editing index.html". Das Textfeld runterscrollen und kurz vor Ende, unmittelbar vor der Anweisung </body>
den folgenden Anweisungsblock hinzufügen:
{if $is->home}
{literal}
<script type="text/javascript">
//Based on 2007 Food and Agriculture Organization of the United Nations'
//Global Livestock Production and Health Atlas
//http://www.abolitionistapproach.com/media/pdf/2007-statistics.pdf.
var animals_per_year = new Array(
new Array("buffaloes", 23199336),
new Array("camels", 1501799),
new Array("cattle", 301275455),
new Array("chickens", 49877536490),
new Array("ducks", 2676365000),
new Array("goats", 402611664),
new Array("horses", 5018470),
new Array("pigs", 1375940758),
new Array("sheep", 564785251),
new Array("turkeys", 635382008)
);
var seconds_elapsed = 0;
var seconds_per_year = 365.256366 * 24 * 60 * 60;
function runCounter() { for (var i = 0; i < animals_per_year.length; i++) { var current = animals_per_year[i][1] / seconds_per_year * seconds_elapsed; document.getElementById("counter" + i).innerHTML = addCommas("" + Math.floor(current)) + " " + animals_per_year[i][0]; } seconds_elapsed += 0.25; setTimeout("runCounter()", 250); }
function addCommas(sValue) { var sRegExp = new RegExp("(-?[0-9]+)([0-9]{3})"); while (sRegExp.test(sValue)) { sValue = sValue.replace(sRegExp, "$1,$2"); } return sValue; }
runCounter();
</script>
{/literal}
{/if}
Anmerkung: Javascript-Code, der geschweifte Klammern enthält und in ein Template eingefügt werden soll, muss immer in ein {literal}...{/literal} eingebettet werden. Ohne diese Markierung führt die Verwendung der geschweiften Klammern zu einem Syntax-Fehler und zur vorübergehenden Funktionsunfähigkeit deines Blogs (weißer Bildschirm).
3. Auf "Optionen -> K2 Options" gehen und beim Punkt "Sidebar Module" den folgenden HTML-Anweisungsblock einfügen:
<div id="counter">
<div id="counter0"></div>
<div id="counter1"></div>
<div id="counter2"></div>
<div id="counter3"></div>
<div id="counter4"></div>
<div id="counter5"></div>
<div id="counter6"></div>
<div id="counter7"></div>
<div id="counter8"></div>
<div id="counter9"></div>
</div>
Number of animals killed in the world by the meat, dairy and egg industries, since you opened this webpage. This does not include the billions of fish and other aquatic animals killed annually.
Based on <a title="Read Global Livestock Production and Health Atlas Statistics" href="http://www.abolitionistapproach.com/media/pdf/2007-glipha-stats.pdf ">2007 statistics</a> from the Food and Agriculture Organization of the United Nations' <a title="Visit Global Livestock Production and Health Atlas Website" href="http://kids.fao.org/glipha/">Global Livestock Production and Health Atlas</a>.
<a title="Get this counter at beAutomated.com" href="http://www.beautomated.com/counter">Get this counter »</a>
Wenn was schief läuft, einfach noch mal hier melden. Ich kann das dann auch notfalls für dich übernehmen.
Veröffentlicht am 2010-05-29 07:03:38
#