Skip to content

Instantly share code, notes, and snippets.

<? if ( 'my_posttype' == get_post_type() )
{
global $post;
if ( $post->post_parent )
{
include dirname( __FILE__ ) . '/single-my_posttype-child.php';
return;
}
}
<?php
$loop = new WP_Query( array(
'post_type' => 'team',
'posts_per_page' => 4,
));
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
In the template:
<ul class="cf" id="port-grid">
<li class="web">
<a href="#">
<img src="img/img1.jpg" alt="">
<span>
<span>Title</span>
<span>Excerpt</span>
</span>
</a>
include_once( CHILD_DIR . '/featured-post-widget.php' );
add_action( 'widgets_init', 'load_custom_child_widget' );
function load_custom_child_widget() {
unregister_widget( 'Genesis_Featured_Post' );
register_widget( 'Genesis_Child_Featured_Post' );
}
@bmoredrew
bmoredrew / keybase.md
Created April 23, 2014 21:03
keybase.md

Keybase proof

I hereby claim:

  • I am bmoredrew on github.
  • I am bmoredrew (https://keybase.io/bmoredrew) on keybase.
  • I have a public key whose fingerprint is 2B86 D9A4 6C9A 1BDC 85DD F73B AC84 7E2E BAF6 7B37

To claim this, I am signing this object:

@bmoredrew
bmoredrew / gist:9717783
Last active August 29, 2015 13:57
Update Custom Post Type After Slug Change
UPDATE wp_posts SET post_type = REPLACE(post_type,'old','new');
@bmoredrew
bmoredrew / gist:9638206
Last active August 29, 2015 13:57
add comments
Add this in single.php
<div class="comments">
<?php
if ( comments_open() || '0' != get_comments_number() ) : comments_template();
endif;
?>
</div>
Add this to style.css to center comments section
@bmoredrew
bmoredrew / gist:8295377
Created January 7, 2014 06:23
scp example send db file
scp my_db.sql [email protected]:/username/my_folder/
@bmoredrew
bmoredrew / gist:8295340
Created January 7, 2014 06:16
import mysql dump cli
mysql -u username -p password my_db < my_db.sql
@bmoredrew
bmoredrew / gist:8295317
Created January 7, 2014 06:14
export-db-command-line
mysqldump -u username -p password my_db > my_db.sql