/**
* @package WordPress
* @subpackage Default_Theme
*/
function theme_customizer_register( $wp_customize ) {
// Add Section
$wp_customize->add_section( 'theme_custom_colors',
array(
'title' => __( 'Custom Theme Colors' ),
'description' => __( 'Customize Theme Colors' ),
'priority' => 30,
)
);
// Add Settings
$wp_customize->add_setting( 'background_color' ,
array(
'default' => '#ffffff',
'transport' => 'refresh',
)
);
// Add Control
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color_control',
array(
'label' => __( 'Background Color' ),
'section' => 'theme_custom_colors',
'settings' => 'background_color',
)
));
}
add_action( 'customize_register', 'theme_customizer_register' );
function meta_resources() {
wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css');
wp_enqueue_style('pagepiling', get_template_directory_uri() . '/css/jquery.pagepiling.min.css');
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/all.min.css');
wp_enqueue_style('styrene', get_template_directory_uri() . '/fonts/1809-CGUQXM.css');
wp_enqueue_style('leaflet', get_template_directory_uri() . '/leaflet/leaflet.css');
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '4.1.0', true );
wp_enqueue_script( 'fullpage-scrolloverflow', get_template_directory_uri() . '/js/scrolloverflow.min.js', array('jquery'), '0.0.9', true );
wp_enqueue_script( 'pagepiling-js', get_template_directory_uri() . '/js/jquery.pagepiling.min.js', array('jquery'), '3.0.2', true );
wp_enqueue_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.2/webfont.js', array('jquery'), '1.6.26', true );
wp_enqueue_script( 'meta-js', get_template_directory_uri() . '/js/meta.js', array('jquery'), '1', true );
wp_enqueue_script( 'leaflet-js', get_template_directory_uri() . '/leaflet/leaflet.js', array('jquery'), '1.3.1', true );
}
add_action('wp_enqueue_scripts', 'meta_resources');
/* Add Latest Jquery */
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', get_template_directory_uri() . '/js/jQuery.min.js', false, null);
wp_enqueue_script('jquery');
}
/* Image Sizes */
add_image_size('thumbnail', get_option( 'thumbnail_size_w' ), get_option( 'thumbnail_size_h' ), array( 'center', 'top' ) );
add_image_size('medium', get_option( 'medium_size_w' ), get_option( 'medium_size_h' ), true );
add_image_size('profile', 300, 400, true );
add_image_size('large', get_option( 'large_size_w' ), get_option( 'large_size_h' ), true );
/* Add Menus */
function register_my_menus() {
register_nav_menus(
array(
'main-menu' => __( 'Main Menu' ),
'secondary-menu' => __( 'Secondary Menu' ),
'tertiary-menu' => __( 'Tertiary Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
/* Add ACF Options Page */
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Contact Info',
'menu_title' => 'Contact Info',
'menu_slug' => 'contact-info',
'icon_url' => 'dashicons-share',
'position' => 6,
'capability' => 'edit_posts',
'redirect' => false
));
}
/* Move Yoast to bottom */
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
/* Disable XML-RPC */
add_filter( 'xmlrpc_enabled', '__return_false' );
/* Label ACF Flex Fields*/
function my_acf_flexible_content_layout_title( $title, $field, $layout, $i ) {
// load text sub field
if( $text = get_sub_field('heading') ) {
$anchorlink = strip_tags(get_sub_field('heading'));
$anchorlink = preg_replace('/[^\p{L}\p{N}\s]/u', '', $anchorlink);
$anchorlink = preg_replace('/\s+/', '-', $anchorlink);
$anchorlink = strtolower($anchorlink);
if($i > 0){
$title .= ' - '. $text .' #'.$anchorlink;
}else{
$title .= ' - '. $text;
}
}
// return
return $title;
}
// name
add_filter('acf/fields/flexible_content/layout_title', 'my_acf_flexible_content_layout_title', 10, 4);
// Function to randomize Advanced Custome Fields' Repeaters
function my_acf_load_value3( $value, $post_id, $field ){
shuffle($value);
return $value;
}
// Randomize ACF Clients' Repeater
add_filter('acf/load_value/key=field_5b8df86219996', 'my_acf_load_value3', 10, 3);
// CPTs
function register_custom_post_types() {
register_post_type( 'projects',
array(
'labels' => array(
'name' => __( 'Projects' ),
'singular_name' => __( 'Project' ),
'add_new' => __( 'Add New ' ),
'add_new_item' => __( 'Add New ' ),
'edit' => __( 'Edit ' ),
'edit_item' => __( 'Edit ' ),
'new_item' => __( 'New ' ),
'view' => __( 'View ' ),
'view_item' => __( 'View ' ),
'search_items' => __( 'Search ' ),
'not_found' => __( 'Nothing found' ),
'not_found_in_trash' => __( 'Nothing found in Trash' ),
'parent' => __( 'Parent' ),
'description' => __( '' ),
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => false,
'exclude_from_search' => false,
'menu_position' => 10,
'hierarchical' => true,
'query_var' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-hammer',
'supports' => array( 'title', 'editor','page-attributes')
)
);
register_post_type( 'people',
array(
'labels' => array(
'name' => __( 'People' ),
'singular_name' => __( 'Person' ),
'add_new' => __( 'Add New ' ),
'add_new_item' => __( 'Add New ' ),
'edit' => __( 'Edit ' ),
'edit_item' => __( 'Edit ' ),
'new_item' => __( 'New ' ),
'view' => __( 'View ' ),
'view_item' => __( 'View ' ),
'search_items' => __( 'Search ' ),
'not_found' => __( 'Nothing found' ),
'not_found_in_trash' => __( 'Nothing found in Trash' ),
'parent' => __( 'Parent' ),
'description' => __( '' ),
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => false,
'exclude_from_search' => false,
'menu_position' => 10,
'hierarchical' => true,
'query_var' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-groups',
'supports' => array( 'title', 'editor','page-attributes')
)
);
// News
register_post_type( 'news',
array(
'labels' => array(
'name' => __( 'News & Event' ),
'singular_name' => __( 'News/Event' ),
'add_new' => __( 'Add News/Event' ),
'add_new_item' => __( 'Add News/Event' ),
'edit' => __( 'Edit ' ),
'edit_item' => __( 'Edit ' ),
'new_item' => __( 'New ' ),
'view' => __( 'View ' ),
'view_item' => __( 'View ' ),
'search_items' => __( 'Search News' ),
'not_found' => __( 'Nothing found' ),
'not_found_in_trash' => __( 'Nothing found in Trash' ),
'parent' => __( 'Parent' ),
'description' => __( '' ),
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => false,
'exclude_from_search' => false,
'menu_position' => 10,
'hierarchical' => true,
'query_var' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-media-text',
'supports' => array( 'title', 'editor','page-attributes')
)
);
// Events
register_post_type( 'awards',
array(
'labels' => array(
'name' => __( 'Awards' ),
'singular_name' => __( 'Awards' ),
'add_new' => __( 'Add Award ' ),
'add_new_item' => __( 'Add Award/ ' ),
'edit' => __( 'Edit ' ),
'edit_item' => __( 'Edit ' ),
'new_item' => __( 'New ' ),
'view' => __( 'View ' ),
'view_item' => __( 'View ' ),
'search_items' => __( 'Search Award' ),
'not_found' => __( 'Nothing found' ),
'not_found_in_trash' => __( 'Nothing found in Trash' ),
'parent' => __( 'Parent' ),
'description' => __( '' ),
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => false,
'exclude_from_search' => false,
'menu_position' => 10,
'hierarchical' => true,
'query_var' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-calendar-alt',
'supports' => array( 'title', 'editor','page-attributes')
)
);
// Pre Qualification of sub consultant
register_post_type( 'prequalofsub',
array(
'labels' => array(
'name' => __( 'All Pre Qual. of Sub' ),
'singular_name' => __( 'Pre Qual. of Sub' ),
'add_new' => __( 'Add Pre Qual.' ),
'add_new_item' => __( 'Add Pre Qual.' ),
'edit' => __( 'Edit ' ),
'edit_item' => __( 'Edit ' ),
'new_item' => __( 'New ' ),
'view' => __( 'View ' ),
'view_item' => __( 'View ' ),
'search_items' => __( 'Search Pre Qual.' ),
'not_found' => __( 'Nothing found' ),
'not_found_in_trash' => __( 'Nothing found in Trash' ),
'parent' => __( 'Parent' ),
'description' => __( '' ),
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => false,
'exclude_from_search' => false,
'menu_position' => 10,
'hierarchical' => true,
'query_var' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-clipboard',
'supports' => array( 'title', 'editor','page-attributes')
)
);
// brochure post type
register_post_type( 'brochure',
array(
'labels' => array(
'name' => __( 'Brochure' ),
'singular_name' => __( 'Brochure' ),
'add_new' => __( 'Add Brochure' ),
'add_new_item' => __( 'Add Brochure' ),
'edit' => __( 'Edit ' ),
'edit_item' => __( 'Edit ' ),
'new_item' => __( 'New ' ),
'view' => __( 'View ' ),
'view_item' => __( 'View ' ),
'search_items' => __( 'Search Brochure' ),
'not_found' => __( 'Nothing found' ),
'not_found_in_trash' => __( 'Nothing found in Trash' ),
'parent' => __( 'Parent' ),
'description' => __( '' ),
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => false,
'exclude_from_search' => false,
'menu_position' => 10,
'hierarchical' => true,
'query_var' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-welcome-widgets-menus',
'supports' => array( 'title', 'editor','page-attributes')
)
);
}
add_action( 'init', 'register_custom_post_types' );
// Register Taxonomies
function my_taxonomies_our_stories() {
$labels = array(
'name' => _x( 'Types', 'taxonomy general name' ),
'singular_name' => _x( 'Type', 'taxonomy singular name' ),
'search_items' => __( 'Search' ),
'all_items' => __( 'All' ),
'parent_item' => __( 'Parent' ),
'parent_item_colon' => __( 'Parent' ),
'edit_item' => __( 'Edit' ),
'update_item' => __( 'Update' ),
'add_new_item' => __( 'Add New' ),
'new_item_name' => __( 'New' ),
'menu_name' => __( 'Types' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'show_admin_column' => true
);
register_taxonomy( 'type', 'projects', $args );
}
add_action( 'init', 'my_taxonomies_our_stories', 0 );
Uncategorized Archives - Atane Consulting
Archive for the ‘Uncategorized’ Category
Sunday, September 2nd, 2018
WordPress is an award-winning web software, used by millions of webmasters worldwide for building their website or blog. SiteGround is proud to host this particular WordPress installation and provide users with multiple resources to facilitate the management of their WP websites:
SiteGround provides superior WordPress hosting focused on speed, security and customer service. We take care of WordPress sites security with unique server-level customizations, WP auto-updates, and daily backups. We make them faster by regularly upgrading our hardware, offering free CDN with Railgun and developing our SuperCacher that speeds sites up to 100 times! And last but not least, we provide real WordPress help 24/7! Learn more about SiteGround WordPress hosting
WordPress tutorial and knowledgebase articles
WordPress is considered an easy to work with software. Yet, if you are a beginner you might need some help, or you might be looking for tweaks that do not come naturally even to more advanced users. SiteGround WordPress tutorial includes installation and theme change instructions, management of WordPress plugins, manual upgrade and backup creation, and more. If you are looking for a more rare setup or modification, you may visit SiteGround Knowledgebase .
SiteGround experts not only develop various solutions for WordPress sites, but also create unique designs that you could download for free. SiteGround WordPress themes are easy to customize for the particular use of the webmaster.
Posted in Uncategorized | No Comments »