';
}
$items = $homelink . $items;
return $items;
}
add_filter('wp_list_pages', 'business_directory_home_nav_menu_items');
/* ----------------------------------------------------------------------------------- */
/* Function to call first uploaded image in functions file
/*----------------------------------------------------------------------------------- */
function business_directory_main_image() {
global $post, $posts;
//This is required to set to Null
$id = '';
$the_title = '';
// Till Here
$permalink = get_permalink($id);
$homeLink = get_template_directory_uri();
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('//i', $post->post_content, $matches);
if (isset($matches [1] [0])) {
$first_img = $matches [1] [0];
}
if (empty($first_img)) { //Defines a default image
echo '';
} else {
print "";
}
}
/* ----------------------------------------------------------------------------------- */
/* Attachment Page Design
/*----------------------------------------------------------------------------------- */
//For Attachment Page
if (!function_exists('business_directory_posted_in')) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
*/
function business_directory_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 %1$s and tagged %2$s. Bookmark the permalink', 'business-directory');
} elseif (is_object_in_taxonomy(get_post_type(), 'category')) {
$posted_in = __('This entry was posted in %1$s. Bookmark the permalink.', 'business-directory');
} else {
$posted_in = __('Bookmark the permalink.', 'business-directory');
}
// Prints the string, replacing the placeholders.
printf(
$posted_in, get_the_category_list(', '), $tag_list, get_permalink(), the_title_attribute('echo=0')
);
}
endif;
/**
* 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 = 472;
/**
* Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
*
* To override business_directory_widgets_init() in a child theme, remove the action hook and add your own
* function tied to the init hook.
*
* @uses register_sidebar
*/
function business_directory_widgets_init() {
//Area 4 Default widget area for pages
register_sidebar(array(
'name' => __('Pages Widget Area', 'business-directory'),
'id' => 'pages-widget-area',
'description' => __('The default pages for pages widget area', 'business-directory'),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
));
// Area 6, located in the footer. Sample content by default.
register_sidebar(array(
'name' => __('First Footer Widget Area', 'business-directory'),
'id' => 'first-footer-widget-area',
'description' => __('First Footer Widget Area', 'business-directory'),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 7, located in the footer. Sample content by default.
register_sidebar(array(
'name' => __('Second Footer Widget Area', 'business-directory'),
'id' => 'second-footer-widget-area',
'description' => __('Second Footer Widget Area', 'business-directory'),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 8, located in the footer. Sample content by default.
register_sidebar(array(
'name' => __('Third Footer Widget Area', 'business-directory'),
'id' => 'third-footer-widget-area',
'description' => __('Third Footer Widget Area', 'business-directory'),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 9, located in the footer. Sample content by default.
register_sidebar(array(
'name' => __('Fourth Footer Widget Area', 'business-directory'),
'id' => 'fourth-footer-widget-area',
'description' => __('Fourth Footer Widget Area', 'business-directory'),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
}
/** Register sidebars by running business_directory_widgets_init() on the widgets_init hook. */
add_action('widgets_init', 'business_directory_widgets_init');
/**
* business_directory_business_directory_pagination
*
*/
function business_directory_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 "