'custom_menu', 'menu_class' => 'sf-menu', 'menu_id' => 'menu', 'fallback_cb' => 'indreams_nav_fallback')); }else{ indreams_nav_fallback(); } } function indreams_nav_fallback() { ?> 'custom_menu', 'menu_class' => '', 'menu_id' => '', 'fallback_cb' => 'indreams_mobile_nav_fallback')); }else{ indreams_nav_fallback(); } } function indreams_mobile_nav_fallback() { ?> /i', $post->post_content, $matches); if (isset($matches [1] [0])) { $img_source = $matches [1] [0]; } if($img_source){ $img_path = regalway_image_resize($img_source, $w, $h); if (!empty($img_path['url'])) { print "Post Image"; } } } /** * This function thumbnail id and * returns thumbnail image * @param type $iw * @param type $ih */ function indreams_get_thumbnail($iw, $ih) { $id=""; $permalink = get_permalink($id); $thumb = get_post_thumbnail_id(); if($thumb){ $image = indreams_thumbnail_resize($thumb, '', $iw, $ih, true, 90); if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { print ""; } } } function indreams_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar(array( 'name' => 'My First Widget', 'id' => 'primary-widget-area', 'description' => 'My First Widget', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. register_sidebar(array( 'name' => 'My Second Widget', 'id' => 'secondary-widget-area', 'description' => 'My second widget', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); // Area 3, located in the footer. Empty by default. register_sidebar(array( 'name' => INDREAMS_FIRST_FOOTER_WIDGET, 'id' => 'first-footer-widget-area', 'description' => INDREAMS_THE_FIRST_FOOTER_WIDGET, 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', )); // Area 4, located in the footer. Empty by default. register_sidebar(array( 'name' => INDREAMS_SECONDRY_FOOTER_WIDGET, 'id' => 'second-footer-widget-area', 'description' => INDREAMS_THE_SECONDRY_FOOTER_WIDGET, 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', )); // Area 5, located in the footer. Empty by default. register_sidebar(array( 'name' => INDREAMS_THIRD_FOOTER_WIDGET, 'id' => 'third-footer-widget-area', 'description' => INDREAMS_THE_THIRD_FOOTER_WIDGET, 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', )); // Area 6, located in the footer. Empty by default. register_sidebar(array( 'name' => INDREAMS_FOURTH_FOOTER_WIDGET, 'id' => 'fourth-footer-widget-area', 'description' => INDREAMS_THE_FOURTH_FOOTER_WIDGET, 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', )); } /** Register sidebars by running indreams_widgets_init() on the widgets_init hook. */ add_action('widgets_init', 'indreams_widgets_init'); /** * Pagination for blog page * */ function indreams_numeric_posts_nav() { if( is_singular() ) return; global $wp_query; /** Stop execution if there's only 1 page */ if( $wp_query->max_num_pages <= 1 ) return; $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; $max = intval( $wp_query->max_num_pages ); /** Add current page to the array */ if ( $paged >= 1 ) $links[] = $paged; /** Add the pages around the current page to the array */ if ( $paged >= 3 ) { $links[] = $paged - 1; $links[] = $paged - 2; } if ( ( $paged + 2 ) <= $max ) { $links[] = $paged + 2; $links[] = $paged + 1; } echo '' . "\n"; } function indreams_get_option($name) { $options = get_option('indreams_options'); if (isset($options[$name])) return $options[$name]; } // function indreams_update_option($name, $value) { $options = get_option('indreams_options'); $options[$name] = $value; return update_option('indreams_options', $options); } // function indreams_delete_option($name) { $options = get_option('indreams_options'); unset($options[$name]); return update_option('indreams_options', $options); } /* ----------------------------------------------------------------------------------- */ /* Custom CSS Styles */ /* ----------------------------------------------------------------------------------- */ function indreams_of_head_css() { $output = ''; $custom_css = indreams_get_option('indreams_customcss'); if ($custom_css <> '') { $output .= $custom_css . "\n"; } // Output styles if ($output <> '') { $output = "\n\n"; echo $output; } } add_action('wp_head', 'indreams_of_head_css'); /* ----------------------------------------------------------------------------------- */ /* Add Favicon /*----------------------------------------------------------------------------------- */ function indreams_favicon() { if (indreams_get_option('indreams_favicon') != '') { echo '' . "\n"; } else { ?>