';
}
$items = $homelink . $items;
return $items;
}
add_filter('wp_list_pages', 'inkthemes_nav_menu_items');
/**
* This function thumbnail id and
* returns thumbnail image
* @param type $iw
* @param type $ih
*/
function inkthemes_get_thumbnail($iw, $ih) {
$permalink = get_permalink();
$thumb = get_post_thumbnail_id();
$image = inkthemes_thumbnail_resize($thumb, '', $iw, $ih, true, 90);
if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail()) && function_exists('the_post_thumbnail')) {
print "";
}
}
/**
* This function gets image width and height and
* Prints attached images from the post
*/
function inkthemes_get_image($width, $height) {
$w = $width;
$h = $height;
global $post, $posts;
//This is required to set to Null
$img_source = '';
$permalink = get_permalink();
ob_start();
ob_end_clean();
$output = preg_match_all('//i', $post->post_content, $matches);
if (isset($matches [1] [0])) {
$img_source = $matches [1] [0];
$img_path = inkthemes_image_resize($img_source, $w, $h);
print "";
}
}
//For Attachment Page
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
*/
function inkthemes_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list('', ', ');
if ($tag_list) {
$posted_in = THIS_ENTRY_WAS_POSTED_IN . ' .' . AND_TAGGED . ' %2$s.' . BOOKMARK_THE . ' ' . PERMALINK . '.';
} elseif (is_object_in_taxonomy(get_post_type(), 'category')) {
$posted_in = THIS_ENTRY_WAS_POSTED_IN . ' %1$s. ' . BOOKMARK_THE . ' ' . PERMALINK . '.';
} else {
$posted_in = BOOKMARK_THE . '' . PERMALINK . '.';
}
// Prints the string, replacing the placeholders.
printf(
$posted_in, get_the_category_list(', '), $tag_list, get_permalink(), the_title_attribute('echo=0')
);
}
/**
* Set the content width based on the theme's design and stylesheet.
*
* Used to set the width of images and content. Should be equal to the width the theme
* is designed for, generally via the style.css stylesheet.
*/
if (!isset($content_width))
$content_width = 590;
/**
* Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
*
* To override twentyten_widgets_init() in a child theme, remove the action hook and add your own
* function tied to the init hook.
*
* @uses register_sidebar
*/
function inkthemes_widgets_init() {
// Area 1, located at the top of the sidebar.
register_sidebar(array(
'name' => PRIMARY_WIDGET,
'id' => 'primary-widget-area',
'description' => THE_PRIMARY_WIDGET,
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
));
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar(array(
'name' => SECONDRY_WIDGET,
'id' => 'secondary-widget-area',
'description' => THE_SECONDRY_WIDGET,
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
));
}
/** Register sidebars by running inkthemes_widgets_init() on the widgets_init hook. */
add_action('widgets_init', 'inkthemes_widgets_init');
/**
* Pagination
*/
function inkthemes_pagination($pages = '', $range = 2) {
$showitems = ($range * 2) + 1;
global $paged;
if (empty($paged))
$paged = 1;
if ($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
echo "