tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 825, 510, true );
if ( ! isset( $content_width ) ) $content_width = 900;
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'workfree_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
function orry_scripts() {
wp_enqueue_style( 'workfree-style', get_stylesheet_uri());
wp_enqueue_style('workfree-style-custom',get_template_directory_uri(). '/css/style.css');
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'orry_scripts' );
$args = array(
'flex-width' => true,
'width' => 980,
'flex-height' => true,
'height' => 490,
'default-image' => get_template_directory_uri() . '/images/header.jpg',
);
add_theme_support( 'custom-header', $args );
register_default_headers( array(
'default-image' => array(
'url' => get_template_directory_uri() . '/images/header.jpg',
'thumbnail_url' => get_template_directory_uri() . '/images/header.jpg',
)));
the_post_thumbnail();
/*
* Pagination for theme
*
*/
function orry_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 "
\n";
}
}
/* Pagination End */
/*escape space*/
function escape_space($content){
$content = str_replace("
", '', $content);
$content = str_replace("
\n", '', $content);
$content = str_replace("", '', $content);
$content = str_replace("\n", '', $content);
return $content;
}
/* Add your nav menus function to the 'init' action hook. */
add_action( 'init', 'aptel_register_menus' );
add_action( 'widgets_init', 'aptel_widget' );
// Add Widget feature
function aptel_widget()
{
register_widget("aptel_widget_info");
}
class aptel_widget_info extends WP_Widget {
// Name of widget where the widget will be displayed as widget name
function aptel_widget_info() {
$this -> WP_Widget('aptel_widget_info', 'Aptel Contact', $widget_ops);
}
// Designing the form to be displayed in admin dashboard widget.
public function form($instance) {
if ( isset( $instance[ 'address' ]) && isset ($instance[ 'phone' ]) && isset($instance[ 'email' ]) ) {
$address = $instance[ 'address' ];
$phone = $instance[ 'phone' ];
$email = $instance[ 'email' ];
}
else {
$address = __( '', 'bc_widget_title' );
$phone = __( '', 'bc_widget_title' );
$email = __( '', 'bc_widget_title' );
} ?>
Address:
phone:
Email:
Contact Details:
Address
'. $address .'';
echo '
Phone
P: ' . $phone . '';
echo '
Email Address
' . $email . '';
echo $after_widget; //Widget ends printing information
}
}
function update($new_instance, $old_instance) {}
function widget($args, $instance) {}
// Add menu features
function aptel_register_menus() {
register_nav_menus(array('primary'=>__('Primary Menu'),));
}
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Primary Sidebar',
'id' => 'primary-sidebar',
'description' => 'These are widgets for primary sidebar.',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
'
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Contact Sidebar',
'id' => 'contact-sidebar',
'description' => 'These are widgets for Contact Page.',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
'
));
/*******
*
* Sidebar Ends
*
**********/
add_action('init', 'init_theme_method');
function init_theme_method() {
add_thickbox();
}
/*
* Limit the number of words in the excerpt
*/
function limit_words_count($string, $word_limit)
{
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit)
array_pop($words);
return implode(' ', $words);
}
?>