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.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
/*content page thumbnail */
add_image_size( 'content-post-thumbnail', 270, 180);
add_image_size( 'content-page-thumbnail', 630, 330);
add_image_size( 'content-single-thumbnail', 630, 330);
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'framework' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'framework_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif; // framework_setup
add_action( 'after_setup_theme', 'framework_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function framework_content_width() {
$GLOBALS['content_width'] = apply_filters( 'framework_content_width', 640 );
}
add_action( 'after_setup_theme', 'framework_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function framework_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'framework' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer', 'framework' ),
'id' => 'footer',
'description' => '',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'framework_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function framework_scripts() {
wp_enqueue_style( 'framework-style', get_stylesheet_uri() );
wp_enqueue_style('font-awesome', get_stylesheet_directory_uri().'/css/font-awesome.min.css');
wp_enqueue_script( 'framework-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'framework-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'framework_scripts' );
/**
* Remove junk from head. WordPress puts a lots of stuff via wp_head() hook.
* Some of this stuff is useful and some isn’t, choose wisely.
*
* @see http://codex.wordpress.org/Function_Reference/remove_action
*/
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
remove_action('wp_head', 'wp_generator'); // remove wordpress version
remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
remove_action('wp_head', 'index_rel_link'); // remove link to index page
remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
remove_action('wp_head', 'start_post_rel_link', 10, 0); // remove random post link
remove_action('wp_head', 'parent_post_rel_link', 10, 0); // remove parent post link
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // remove the next and previous post links
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Custom widget area for social buttons
*
* @see https://codex.wordpress.org/Widgets_API#Function_Reference
*/
class Social_Widget extends WP_Widget{
function Social_Widget(){
$widget_ops = array(
'classname'=>'social_networks',
'description' => __('Widget for social networks buttons','framework')
);
$control_ops = array(
'width' => 300,
'height' => 350,
'id_base' => 'social-widget'
);
$this->WP_Widget('social-widget', __('Social Widget( by Zdravko Lukic)','framework'),$widget_ops,$control_ops);
}
function widget($args,$instance){
$title = apply_filters('widget_title',$instance['title']);
$facebook = $instance['facebook'];
$twitter = $instance['twitter'];
$google = $instance['google'];
$linked = $instance['linked'];
$instagram = $instance['instagram'];
$flickr = $instance['flickr'];
$pinterest = $instance['pinterest'];
$tumblr = $instance['tumblr'];
$dribbble = $instance['dribbble'];
$rss = $instance['rss'];
$youtube = $instance['youtube'];
$vimeo = $instance['vimeo'];
$facebook_profile = '';//promeni klasu u a tagu da bude drugaciji
$twitter_profile = '';
$google_profile = '';
$linked_profile = '';
$instagram_profile = '';
$flickr_profile = '';
$pinterest_profile = '';
$tumblr_profile = '';
$dribbble_profile = '';
$rss_profile = '';
$youtube_profile = '';
$vimeo_profile = '';
echo $args['before_widget'];
if(!empty($title)){
echo $args['before_title'] . $title . $args['after_title'];
}
echo '';
echo (!empty($facebook)) ? $facebook_profile : null;
echo (!empty($twitter)) ? $twitter_profile : null;
echo (!empty($google)) ? $google_profile : null;
echo (!empty($linked)) ? $linked_profile : null;
echo (!empty($instagram)) ? $instagram_profile : null;
echo (!empty($flickr)) ? $flickr_profile : null;
echo (!empty($pinterest)) ? $pinterest_profile : null;
echo (!empty($tumblr)) ? $tumblr_profile : null;
echo (!empty($dribbble)) ? $dribbble_profile : null;
echo (!empty($rss)) ? $rss_profile : null;
echo (!empty($youtube)) ? $youtube_profile : null;
echo (!empty($vimeo)) ? $vimeo_profile : null;
echo '
';
echo $args['after_widget'];
}
function update($new_instance, $old_instance){
$instance = array();
$instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
$instance['facebook'] = (!empty($new_instance['facebook'])) ? strip_tags($new_instance['facebook']) : '';
$instance['twitter'] = (!empty($new_instance['twitter'])) ? strip_tags($new_instance['twitter']) : '';
$instance['google'] = (!empty($new_instance['google'])) ? strip_tags($new_instance['google']) : '';
$instance['linked'] = (!empty($new_instance['linked'])) ? strip_tags($new_instance['linked']) : '';
$instance['instagram'] = (!empty($new_instance['instagram'])) ? strip_tags($new_instance['instagram']) : '';
$instance['flickr'] = (!empty($new_instance['flickr'])) ? strip_tags($new_instance['flickr']) : '';
$instance['pinterest'] = (!empty($new_instance['pinterest'])) ? strip_tags($new_instance['pinterest']) : '';
$instance['tumblr'] = (!empty($new_instance['tumblr'])) ? strip_tags($new_instance['tumblr']) : '';
$instance['dribbble'] = (!empty($new_instance['dribbble'])) ? strip_tags($new_instance['dribbble']) : '';
$instance['rss'] = (!empty($new_instance['rss'])) ? strip_tags($new_instance['rss']) : '';
$instance['youtube'] = (!empty($new_instance['youtube'])) ? strip_tags($new_instance['youtube']) : '';
$instance['vimeo'] = (!empty($new_instance['vimeo'])) ? strip_tags($new_instance['vimeo']) : '';
return $instance;
}
function form($instance){
isset($instance['title']) ? $title = $instance['title'] : null;
empty($instance['title']) ? $title = 'Social Profile' : null;
//social options
isset($instance['facebook']) ? $facebook = $instance['facebook'] : null;
isset($instance['twitter']) ? $twitter = $instance['twitter'] : null;
isset($instance['google']) ? $google = $instance['google'] : null;
isset($instance['linked']) ? $linked = $instance['linked'] : null;
isset($instance['instagram']) ? $instagram = $instance['instagram'] : null;
isset($instance['flickr']) ? $flickr = $instance['flickr'] : null;
isset($instance['pinterest']) ? $pinterest = $instance['pinterest'] : null;
isset($instance['tumblr']) ? $tumblr = $instance['tumblr'] : null;
isset($instance['dribbble']) ? $dribbble = $instance['dribbble'] : null;
isset($instance['rss']) ? $rss = $instance['rss'] : null;
isset($instance['youtube']) ? $youtube = $instance['youtube'] : null;
isset($instance['vimeo']) ? $vimeo = $instance['vimeo'] : null;
?>