'Page Sidebar',
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
}
///////////////////////////////////////////////////////
// Set the content width based on the theme's design and stylesheet.
if ( ! isset( $content_width ) )
$content_width = 872;
///////////////////////////////////////////////////////
if (function_exists( 'add_theme_support' )){
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
add_filter('manage_pages_columns', 'posts_columns', 5);
add_action('manage_pages_custom_column', 'posts_custom_columns', 5, 2);
}
function posts_columns($defaults){
$defaults['wps_post_thumbs'] = 'Thumbs';
return $defaults;
}
function posts_custom_columns($column_name, $id){
if($column_name === 'wps_post_thumbs'){
echo the_post_thumbnail( array(125,80) );
}
}
///////////////////////////////////////////////////////
// Add more colour selectors
add_action( 'customize_register', 'listablehg_customize_register' );
function listablehg_customize_register($wp_customize)
{
$colors = array();
$colors[] = array( 'slug'=>'link_color', 'default' => '#56B33D', 'label' => __( 'Link Color', 'Alpine' ) );
$colors[] = array( 'slug'=>'head_color', 'default' => '#000000', 'label' => __( 'H1, H2, H3 Color', 'Alpine' ) );
foreach($colors as $color)
{
// SETTINGS
$wp_customize->add_setting( $color['slug'], array( 'default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options' ));
// CONTROLS
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $color['slug'], array( 'label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug'] )));
}
// Add Header Text
$wp_customize->add_setting( 'header_text', array(
'default' => 'Alpine',
'type' => 'option',
'capability' => 'manage_options',
) );
$wp_customize->add_control( 'header_text', array(
'label' => 'Header Text',
'section' => 'title_tagline',
) );
// Add Sub Header Text
$wp_customize->add_setting( 'sub_header_text', array(
'default' => 'Edit me in the Theme Customizer',
'type' => 'option',
'capability' => 'manage_options',
) );
$wp_customize->add_control( 'sub_header_text', array(
'label' => 'Sub Header Text',
'section' => 'title_tagline',
) );
}
add_theme_support( 'custom-background', array(
// Let WordPress know what our default background color is.
// This is dependent on our current color scheme.
'default-color' => '#F0F0F0',
) );
add_theme_support( 'automatic-feed-links' );
///////////////////////////////////////////////////////
// Add support for custom headers.
$args = array(
'width' => 1400,
'height' => 260,
'flex-width' => true,
'flex-height' => true,
'default-text-color' => '000000',
'default-image' => get_template_directory_uri() . '/header/pinzolo.jpg',
);
add_theme_support( 'custom-header', $args );
///////////////////////////////////////////////////////
add_theme_support( 'post-thumbnails' );
add_image_size( 'page_header', 1400, 260, false );
add_image_size( 'portfolio', 250, 250, true );
///////////////////////////////////////////////////////
// Returns the parent of a page. If the page does not have a parent, returns 0.
function get_parentId() {
global $post;
echo($post->post_parent->title);
return $post->post_parent;
};
///////////////////////////////////////////////////////
// Custom menu
add_action('init', 'register_custom_menu');
function register_custom_menu() {
register_nav_menu('top', 'Top Menu');
}
//to show a home link
function alpine_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'alpine_page_menu_args' );
///////////////////////////////////////////////////////
//change admin footer
function remove_footer_admin () {
echo 'Fueled by WordPress | Designed by thrive
';
echo '';
}
add_filter('admin_footer_text', 'remove_footer_admin');
///////////////////////////////////////////////////////
//Remove admin tool bar
function my_function_admin_bar(){
return 0;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
///////////////////////////////////////////////////////
// Custom comments
function my_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
. WordPress will add it itself once it's done listing any children and whatnot.
///////////////////////////////////////////////////////
# Will return true if there is a next page
function has_next_page() {
global $paged, $max_page;
return $paged < $max_page;
}
# Will return true if there is a previous page
function has_previous_page() {
global $paged;
return $paged > 1;
}
# Will return true if there is more than one page (either before or after).
function has_pagination() {
return has_next_page() or has_previous_page();
}
///////////////////////////////////////////////////////
/**
* Plugin Name: PBD AJAX Load Posts
* Plugin URI: http://www.problogdesign.com/
* Description: Load the next page of posts with AJAX.
* Version: 0.1
* Author: Pro Blog Design
* Author URI: http://www.problogdesign.com/
*/
/**
* Initialization. Add our script if needed on this page.
*/
function pbd_alp_init() {
global $wp_query;
// Add code to index pages.
if( !is_singular() ) {
// Queue JS and CSS
wp_enqueue_script(
'pbd-alp-load-posts',
get_template_directory_uri('template_url') . '/js/load-posts.js',
array('jquery'),
'1.0',
true
);
// What page are we on? And what is the pages limit?
$max = $wp_query->max_num_pages;
$paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;
// Add some parameters for the JS.
wp_localize_script(
'pbd-alp-load-posts',
'pbd_alp',
array(
'startPage' => $paged,
'maxPages' => $max,
'nextLink' => next_posts($max, false)
)
);
}
}
add_action('template_redirect', 'pbd_alp_init');
?>
' ); ?>
comment_approved == '0') : ?> Your comment is awaiting moderation