/*
Theme Name: twentytwentyone-child
Template: twentytwentyone
Author: Shoeb Akhtar
Description: Twenty Twenty-One is a blank canvas for your ideas and it makes the block editor your best brush. With new block patterns, which allow you to create a beautiful layout in a matter of seconds, this theme’s soft colors and eye-catching — yet timeless — design will let your work shine. Take it for a spin! See how Twenty Twenty-One elevates your portfolio, business website, or personal blog.
Twenty Twenty-One WordPress Theme, (C) 2020 WordPress.org
Twenty Twenty-One is distributed under the terms of the GNU GPL.
*/
add on the root :-
screenshot.png
function.php
header.php
footer.php
index.php
sidebar.php
style.css
> //This function gives the body element different classes and can be added, typically, in the header.php's HTML body tag. Basic Usage.
wp_body_open() is an action hook introduced in WordPress 5.2 that allows developers to insert code directly after the opening body tag in a theme.
get_template_part('folder-name/sub-folder/file-name');
get_template_part('template-parts/upcoming-training/ucomingslider');
get_template_part('template-parts/our-servicess/ourservicess');
get_template_part('template-parts/client-sector/client-sector-post-type');
get_template_part('template-parts/review-post/review-post');
get_template_part('template-parts/vision-and-mission/vision-and-mission');
get_template_part('template-parts/our-team/our-team');
array(
'name' => 'Vision and Mission',
'singular_name' => 'Vision and Mission',
'category' => 'Category'
),
'public' => true, // Set to true if you want the post type to be publicly accessible
'has_archive' => true, // Set to true if you want to enable archives for this post type
'menu_icon' => 'vision-mission',
'rewrite' => array('slug' => 'upcoming-training'), // Customize the URL slug
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail'), // Add 'page-attributes' to enable page attributes
// Add more options and parameters as needed
));
}
add_action('init', 'vision_and_mission_post_type');
// Disable Gutenberg block editor for posts and post types
add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter('use_block_editor_for_post_type', '__return_false', 10);
add_filter('gutenberg_can_edit_post', '__return_false', 10);
add_filter('gutenberg_can_edit_post_type', '__return_false', 10);
// Disables the block editor from managing widgets.
add_filter('use_widgets_block_editor', '__return_false');?>
>
//Menu Register
function menu_register(){
register_nav_menus(
array(
'primary-menu' => __('Primary Menu'),
'headre-button-menu' => __('Main Menu Right Button')
)
);
}
add_action('init','menu_register');
// Add Li Class
function add_additional_class_on_li($classes, $item, $args) {
if(isset($args->add_li_class)) {
$classes[] = $args->add_li_class;
}
return $classes;
}
add_filter('nav_menu_css_class', 'add_additional_class_on_li', 1, 3);
// Add a Class
function add_additional_class_on_a($classes, $item, $args)
{
if (isset($args->add_a_class)) {
$classes['class'] = $args->add_a_class;
}
return $classes;
}
add_filter('nav_menu_link_attributes', 'add_additional_class_on_a', 1, 3);
-------------------------------------------------
# header php WP_NAV_MENU
-------------------------------------------------
'primary-menu',
'menu_class' => 'nav navbar-nav ml-auto align-items-center', // UL Class
'menu_id' => '', //ul id
'container' => false,
'add_li_class' => 'nav-item',
'add_a_class' => 'nav-link',
) );
?>
'headre-button-menu',
'menu_class' => 'nav navbar-nav ml-auto align-items-center', // UL Class
'menu_id' => '', //ul id
'container' => false,
'add_li_class' => 'header-get-a-quote',
'add_a_class' => 'btn btn-primary',
) );
?>
'home_slider', 'posts_per_page' => 10);
$custom_query = new WP_Query($args);
if ($custom_query->have_posts()) :
while ($custom_query->have_posts()) :
$custom_query->the_post();
?>
'upcoming_training', 'posts_per_page' => 10);
$custom_uct_query = new WP_Query($uct_args);
if ($custom_uct_query->have_posts()) :
while ($custom_uct_query->have_posts()) :
$custom_uct_query->the_post();
?>
'our_servicess', 'posts_per_page' => 3);
$custom_oss_query = new WP_Query($oss_args);
if ($custom_oss_query->have_posts()) :
while ($custom_oss_query->have_posts()) :
$custom_oss_query->the_post();
?>
'our_client_sector', 'posts_per_page' => 9);
$ourclientsector_query = new WP_Query($ourclientsector);
if ($ourclientsector_query->have_posts()) :
while ($ourclientsector_query->have_posts()) :
$ourclientsector_query->the_post();
?>