Remove the Genesis Footer
// Remove Footer remove_action( 'genesis_footer', 'genesis_do_footer' );
No title available
Cosmic Funnies
official daine visual archive
noise dept.
Cosimo Galluzzi
Keni
🩵 avery cochrane 🩵
Interview Vampire Daily
Cookie Run:Kingdom Official!
ojovivo
PUT YOUR BEARD IN MY MOUTH
YOU ARE THE REASON
Fai_Ryy

bliss lane

Jar Jar Binks Fan Club
h
No title available
todays bird
NASA

No title available

seen from Netherlands

seen from Iceland
seen from India
seen from Hungary
seen from United States
seen from Brazil
seen from United States
seen from Philippines

seen from United States

seen from Germany

seen from Netherlands

seen from United Kingdom

seen from United States
seen from United States

seen from Malaysia

seen from Brazil
seen from United States
seen from United States
seen from Italy
seen from United States
@delcodezen
Remove the Genesis Footer
// Remove Footer remove_action( 'genesis_footer', 'genesis_do_footer' );
Show Three Posts from A Specific Post Category
Suppose you want to show three featured posts on a page. Â Just put this code in the page template. Â In the query args, use the slug of the post category you want to show. Â And, of course, modify the markup in the loop to fit your specific needs.
// The Query $args = array( 'category_name' => 'featured-post', 'nopaging' => true, 'showposts' => 3 ); $the_query = new WP_Query( $args ); echo '<div id="featured-posts">'; echo '<ul>'; // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo '<li class="featured-post">'; echo '<h2 class="title">'; echo '<a href="' . get_permalink() . '">'; the_title(); echo '</a>'; echo '</h2>'; echo '<a href="' . get_permalink() . '">'; // This line is only for Genesis child themes genesis_image( array( 'size' => 'thumbnail' ) ); echo '</a>'; echo '<div class="post-excerpt">'; the_excerpt(); echo '</div>'; echo '</li>'; endwhile; echo '</ul>'; echo '</div>'; // Reset Post Data wp_reset_postdata();
Post Exceprts
These filters may be used with the WordPress function the_excerpt() which echoes a truncated version of the post content.
If you want to make the default excerpt length shorter:
/** Modify the length of the_excerpt */ add_filter( 'excerpt_length', 'my_excerpt_length' ); function my_excerpt_length($length) { return 20; // pull first 20 words }
If you want to add a link to the read more text:
/** Modify the_excerpt read more text */ add_filter( 'excerpt_more', 'my_excerpt_more' ); function my_excerpt_more( $more ) { return '<a class="more-link" href="' . get_permalink() . '">' . $more . '</a>'; }
Reference a Class Member Function in add_action() (WordPress)
To reference a class member function in add_action, create an array where the first element in the array is a reference to the class instance.
class MyClass { function __construct() { add_action( 'init', array( &$this, 'my_function' ) ); } function my_function() { // do something here } }
If the method is static, you can also use the class name instead of an instance reference.
class MyClass { public static function my_function() { // do something here } } $my_class = new MyClass(); add_action( 'init', array( &$my_class, 'my_function' ) );
Create a Custom Feed in Wordpress
If you want a custom feed located at: .../feed/my-custom-feed:
function my_custom_feed() { // This is where you specify a template to use for your feed (if necessary). // include 'custom-feed-template-file.php'; // - or - // if this is in a plugin: // load_template(ABSPATH.PLUGINDIR.'/plugin-name/custom_feed.php'); } add_feed('my-custom-feed', 'my_custom_feed');
This tells Wordpress to call the function above when a feed called “my-custom-feed” is requested. It also adds this to the rewrite rules. (You need to save permalinks for this to take effect.)
If you’re not going to use a separate template file, you can create a function that gets called when your custom feed is requested:
function do_feed_my_custom_feed( $comments ) { // Add in code to generate the custom feed here. // You can use feed-rss2.php as an example. } add_action('do_feed_my-custom-feed', 'do_feed_my_custom_feed', 10, 1);
Generate A Large File of Random Data (linux)
Create a 1MB file of random data:
dd if=/dev/urandom of=file.txt bs=1048576
Create a 200MB file of random data:
dd if=/dev/urandom of=file.txt bs=1048576 count=200
Create 10 different 200MB files of random data:
for i in {1..10}; do dd if=/dev/urandom of=file-$i.txt bs=1048576 count=200; done;