This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Ein simpler Wortzähler für deine Website | |
* Ausgabe: <p><?php echo word_counter(); ?></p> | |
*/ | |
function word_counter() { | |
return sprintf( | |
__( '%s Wörter', 'Textdomain' ), // Für Übersetzungen! %s wird ersetzt mit der Wortanzahl | |
str_word_count( strip_tags( get_post_field( 'post_content', get_the_ID() ) ) ) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugins controller | |
* | |
* @author Kevin pliester - info@leerzeile.com | |
* @version 1.0 | |
* @date Februar 03, 2016 | |
* @date updated Feb 04, 2016 | |
*/ | |
namespace Controllers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteRule ^([A-Za-z0-9-]+)/?$ /index.php?key=$1 [NC,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://codex.wordpress.org/Class_Reference/WP_Query | |
$args = array( | |
'category_name' => 'KATEGORIE1, KATEGORIE2', // Hier können einzelne Kategorie gewählt werden | |
'post_type' => 'post', // Hier wird angegeben, was angezeigt werden soll. (Post ist Standard; Geht auch Custom Post Type) | |
); | |
$the_query = new WP_Query( $args ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place in your body: | |
// <div id="image"></div> | |
$(document).ready( function() { | |
var subreddit = 'VillagePorn'; // Your Subreddit without /r/ | |
var aRandomNum = Math.floor((Math.random() * 25) + 1); // A random number - range 25 | |
$.getJSON('http://www.reddit.com/r/'+subreddit+'.json?jsonp=?&show=all&limit=25', function(data) { | |
$.each(data.data.children, function(i,item){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Baut die alte Blogroll wieder ein. | |
* [links] gibt alle Links an beliebiger Stelle aus | |
*/ | |
add_filter('pre_option_link_manager_enabled', '__return_true'); | |
function _links() { | |
ob_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********** | |
* Fügt das data-featherlight attribut allen Bildlinks hinzu | |
* Plugin: https://github.com/noelboss/featherlight/ | |
**/ | |
$('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').each(function() { | |
if (this.href.indexOf('?') < 0) { | |
$(this).attr('data-featherlight', 'image'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom Post Type: Team | |
* | |
* @author Pixelbart | |
* @version 1.0 | |
*/ | |
function custom_post_type_team() | |
{ | |
//* Beschriftungen im /wp-admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'team', // Unser post-type sprich team | |
'post_status' => 'publish', // Es sollen nur Beiträge mit den Status "veröffentlicht" ausgeben werden | |
'posts_per_page' => -1 // Es sollen alle Beiträge auf der Seite angezeigt werden | |
); | |
$the_query = new WP_Query( $args ); // Unser WordPress Query, mit dem wir die Beiträge ausgeben werden | |
if ( $the_query->have_posts() ) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$files = array(); | |
$login_nick = null; | |
$login_pass = null; | |
//* loop all user files in users/ with file ending .json | |
foreach(glob('users/*.json') as $file) : | |
//* put json file contents into the users array |