Skip to content

Instantly share code, notes, and snippets.

@jeffgreendesign
Last active August 29, 2015 14:09
Show Gist options
  • Save jeffgreendesign/9de558848d8cea996396 to your computer and use it in GitHub Desktop.
Save jeffgreendesign/9de558848d8cea996396 to your computer and use it in GitHub Desktop.
Common WordPress Code
<?php
// Common WordPress Functions
// Remove [...] string using Filters
// http://codex.wordpress.org/Template_Tags/the_excerpt
function new_excerpt_more( $more ) {
return '..';
}
add_filter('excerpt_more', 'new_excerpt_more');
?>
<!-- Common WordPress Code -->
<!-- http://codex.wordpress.org/Function_Reference/get_home_url -->
<?php echo get_home_url(); ?>
<!-- http://codex.wordpress.org/Function_Reference/get_the_title -->
<?php echo get_the_title(); ?>
<!-- http://codex.wordpress.org/Function_Reference/the_time -->
<?php the_time('n/j/y'); ?>
<!-- http://codex.wordpress.org/Function_Reference/the_excerpt -->
<?php the_excerpt(); ?>
<!-- http://codex.wordpress.org/Function_Reference/the_content -->
<?php the_content(); ?>
<!-- http://codex.wordpress.org/Function_Reference/dynamic_sidebar -->
<?php dynamic_sidebar( 'blog-sidebar' ); ?>
<!-- http://codex.wordpress.org/Function_Reference/get_search_form -->
<?php get_search_form(); ?>
<!-- http://codex.wordpress.org/Function_Reference/wp_nav_menu -->
<?php
$args = array(
'theme_location' => '',
'menu' => '',
'container' => 'div',
'container_class' => '',
'container_id' => '',
'menu_class' => 'menu',
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
); ?>
<?php wp_nav_menu( $args ); ?>
<!-- http://codex.wordpress.org/Function_Reference/wp_list_pages -->
<?php
$args = array(
'authors' => '',
'child_of' => 0,
'date_format' => get_option('date_format'),
'depth' => 0,
'echo' => 1,
'exclude' => '',
'include' => '',
'link_after' => '',
'link_before' => '',
'post_type' => 'page',
'post_status' => 'publish',
'show_date' => '',
'sort_column' => 'menu_order, post_title',
'sort_order' => '',
'title_li' => __('Pages'),
'walker' => ''
); ?>
<?php wp_list_pages( $args ); ?>
<!-- http://codex.wordpress.org/Class_Reference/WP_Query -->
<?php
$args = array(
'post_type' => 'job'
);
$the_query = new WP_Query( $args ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment