ID ) ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); return $image[0]; } else { // Else it will try to grab the First Image from the Post global $post, $posts; $image = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); if ( isset( $matches [1][0]) ) $image = $matches [1][0]; if(empty($image)){ //Defines a default image $imgurl = get_template_directory_uri(); // Gets the Directory Location for the default Image $image = "$imgurl/images/default.png"; // Location of the "Sorry Image Not Available" Image } return $image; // Returns the Value or you can say URL of the image } } function resize_thumbnail_wpden($width = '',$height ='', $path = '') { // Include the library include_once( 'BFI_Thumb.php' ); // Our parameters, do a resize $params = array( 'width' => $width, 'height' => $height ); // Get the URL of our processed image $image = bfi_thumb( $path, $params ); // Print out our img tag return $image; } function post_share() { /* The Below Code is basically just HTML but still created it as a function for resuability and Quick Site wide changes */ ?>
'header-menu', 'menu' => '', 'container' => 'div', 'container_class' => 'container_class', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'nav_fallback', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '', 'depth' => 0, 'walker' => '' ) ); } function nav_fallback() { ?> 1, 'menu_class' => 'nav navbar-nav') ); ?> __('Header Menu', 'wpden'), // Main Navigation )); } // Remove the
surrounding the dynamic navigation to cleanup markup function my_wp_nav_menu_args($args = '') { $args['container'] = false; return $args; } // Remove Injected classes, ID's and Page ID's from Navigation
  • items function my_css_attributes_filter($var) { return is_array($var) ? array() : ''; } // Remove invalid rel attribute values in the categorylist function remove_category_rel_from_category_list($thelist) { return str_replace('rel="category tag"', 'rel="tag"', $thelist); } // Add page slug to body class function add_slug_to_body_class($classes) { global $post; if (is_home()) { $key = array_search('blog', $classes); if ($key > -1) { unset($classes[$key]); } } elseif (is_page()) { $classes[] = sanitize_html_class($post->post_name); } elseif (is_singular()) { $classes[] = sanitize_html_class($post->post_name); } return $classes; } // If Dynamic Sidebar Exists if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => __('Sidebar - Widget Area 1', 'wpden'), 'description' => __('Primary Sidebar on the Right Side of Content', 'wpden'), 'id' => 'widget-area-1', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => __('Footer - Widget Area 1', 'wpden'), 'description' => __('First Widget area of footer Columns', 'wpden'), 'id' => 'footer-widget-area-1', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => __('Footer - Widget Area 2', 'wpden'), 'description' => __('Second Widget area of footer Columns', 'wpden'), 'id' => 'footer-widget-area-2', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => __('Footer - Widget Area 3', 'wpden'), 'description' => __('Third Widget area of footer Columns', 'wpden'), 'id' => 'footer-widget-area-3', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); } // Remove wp_head() injected Recent Comment styles function my_remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' )); } // for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin function wpden_pagination() { global $wp_query; $big = 999999999; echo paginate_links(array( 'base' => str_replace($big, '%#%', get_pagenum_link($big)), 'format' => '?paged=%#%', 'end_size' => '1', 'mid_size' => '5', 'current' => max(1, get_query_var('paged')), 'type' => 'list', 'total' => $wp_query->max_num_pages )); } function wpden_slider_more( $more ) { return ''; } function wpden_slider_len( $length ) { $length = ot_get_option('slider_len',30); return $length; } // Custom Excerpts for Magzine function wpden_mag_len($length) { $length = ot_get_option('pst_excerpt',50); return $length; } function wpden_custom_readmore() { if(ot_get_option('more_text') != ' ') { return ot_get_option('more_text', 'Continue Reading ...'); } else { return ''; } } /* Create the Custom Excerpts callback forr More Information regarding below Function visit : http://wpden.net/create-multiple-excerpts-wordpress/ */ function wpden_excerpt($length_callback = '', $more_callback = '') { global $post; if (function_exists($length_callback)) { add_filter('excerpt_length', $length_callback); } if (function_exists($more_callback)) { add_filter('excerpt_more', $more_callback); } $output = get_the_excerpt(); $output = apply_filters('wptexturize', $output); $output = apply_filters('convert_chars', $output); $output = '

    ' . $output . '

    '; echo $output; } // Custom View Article link to Post function wpden_more_view($more){ global $post; return '' . __(ot_get_option('more_text'), 'wpden') . ''; } add_filter('excerpt_more', 'wpden_more_view'); // Add 'Read More' button instead of [...] for Excerpts // Remove thumbnail width and height dimensions that prevent fluid images in the_thumbnail /*function remove_thumbnail_dimensions( $html ) { $html = preg_replace('/(width|height)=\"\d*\"\s/', "", $html); return $html; } /* BootStrap Shortcodes you can use Bootstraps Icons, buttons,Label,badge,alert and well with this function in your posts without much trouble please not : it's still in beta mode. */ function wpden_bs_shortcode($args, $content = '') { extract(shortcode_atts(array('type' => '','color' => 'default','size' => 'default','link' => '','close' => 'false'), $args)); if($type == 'icon') { $output = ""; } elseif ($type == 'button') { $output = "{$content}"; } elseif ($type == 'label') { $output = "{$content}"; } elseif ($type == 'badge') { $output = "{$content}"; } elseif ($type == 'alert') { $output = "
    "; if($close == 'true') { $output .= ""; } $output .="{$content}
    "; } elseif ($type == 'well') { $output = "
    {$content}
    "; } return $output; } add_shortcode('wpden', 'wpden_bs_shortcode'); // Threaded Comments function enable_threaded_comments() { if (!is_admin()) { if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) { wp_enqueue_script('comment-reply'); } } } // Custom Comments Callback function wpden_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    %s says:'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>
    tags in Dynamic Sidebars (better!) add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args'); // Remove surrounding
    from WP Navigation // add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); // Remove Navigation
  • injected classes (Commented out by default) // add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); // Remove Navigation
  • injected ID (Commented out by default) // add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); // Remove Navigation
  • Page ID's (Commented out by default) add_filter('the_category', 'remove_category_rel_from_category_list'); // Remove invalid rel attribute add_filter('the_excerpt', 'shortcode_unautop'); // Remove auto

    tags in Excerpt (Manual Excerpts only) add_filter('the_excerpt', 'do_shortcode'); // Allows Shortcodes to be executed in Excerpt (Manual Excerpts only) //add_filter('post_thumbnail_html', 'remove_thumbnail_dimensions', 10); // Remove width and height dynamic attributes to thumbnails //add_filter('image_send_to_editor', 'remove_thumbnail_dimensions', 10); // Remove width and height dynamic attributes to post images // Remove Filters remove_filter('the_excerpt', 'wpautop'); // Remove

    tags from Excerpt altogether ?>