first commit

This commit is contained in:
Manish
2024-03-12 11:17:45 +05:45
commit c4d4fe8483
3759 changed files with 1811003 additions and 0 deletions

View File

@ -0,0 +1,78 @@
<?php
/**
* Sample implementation of the Custom Header feature
*
* You can add an optional custom header image to header.php like so ...
*
<?php the_header_image_tag(); ?>
*
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
*
* @package abchospitality
*/
/**
* Set up the WordPress core custom header feature.
*
* @uses abchospitality_header_style()
*/
function abchospitality_custom_header_setup() {
add_theme_support(
'custom-header',
apply_filters(
'abchospitality_custom_header_args',
array(
'default-image' => '',
'default-text-color' => '000000',
'width' => 1000,
'height' => 250,
'flex-height' => true,
'wp-head-callback' => 'abchospitality_header_style',
)
)
);
}
add_action( 'after_setup_theme', 'abchospitality_custom_header_setup' );
if ( ! function_exists( 'abchospitality_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog.
*
* @see abchospitality_custom_header_setup().
*/
function abchospitality_header_style() {
$header_text_color = get_header_textcolor();
/*
* If no custom options for text are set, let's bail.
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ).
*/
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
return;
}
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
?>
.site-title,
.site-description {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text use that.
else :
?>
.site-title a,
.site-description {
color: #<?php echo esc_attr( $header_text_color ); ?>;
}
<?php endif; ?>
</style>
<?php
}
endif;

View File

@ -0,0 +1,54 @@
<?php
function example_customizer( $wp_customize ) {
/* ============== HEADER LOGO
========================== */
$wp_customize->add_section( 'logo_section' , array(
'title' => __( 'Logo' ),
'priority' => 30,
'description' => 'Upload a logo in the header',
) );
$wp_customize->add_setting( 'logo' );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo', array(
'label' => __( 'Logo' ),
'section' => 'logo_section',
'settings' => 'logo',
) ) );
/* ============== Pages
========================== */
$wp_customize->add_section( 'pages_section' , array(
'title' => __( 'First Page' ),
'priority' => 30,
'description' => 'Select the first page:',
) );
$wp_customize->add_setting( 'first_page' );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'your_setting_id',
array(
'label' => __( 'First Page?', 'theme_name' ),
'section' => 'pages_section',
'settings' => 'first_page',
'type' => 'dropdown-pages'
)
)
);
}
add_action( 'customize_register', 'example_customizer' );

View File

@ -0,0 +1,67 @@
<?php
/**
* Jetpack Compatibility File
*
* @link https://jetpack.com/
*
* @package abchospitality
*/
/**
* Jetpack setup function.
*
* See: https://jetpack.com/support/infinite-scroll/
* See: https://jetpack.com/support/responsive-videos/
* See: https://jetpack.com/support/content-options/
*/
function abchospitality_jetpack_setup() {
// Add theme support for Infinite Scroll.
add_theme_support(
'infinite-scroll',
array(
'container' => 'main',
'render' => 'abchospitality_infinite_scroll_render',
'footer' => 'page',
)
);
// Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' );
// Add theme support for Content Options.
add_theme_support(
'jetpack-content-options',
array(
'post-details' => array(
'stylesheet' => 'abchospitality-style',
'date' => '.posted-on',
'categories' => '.cat-links',
'tags' => '.tags-links',
'author' => '.byline',
'comment' => '.comments-link',
),
'featured-images' => array(
'archive' => true,
'post' => true,
'page' => true,
),
)
);
}
add_action( 'after_setup_theme', 'abchospitality_jetpack_setup' );
if ( ! function_exists( 'abchospitality_infinite_scroll_render' ) ) :
/**
* Custom render function for Infinite Scroll.
*/
function abchospitality_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_type() );
endif;
}
}
endif;

View File

@ -0,0 +1,37 @@
<?php
/**
* Functions which enhance the theme by hooking into WordPress
*
* @package abchospitality
*/
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function abchospitality_body_classes( $classes ) {
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
// Adds a class of no-sidebar when there is no sidebar present.
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
$classes[] = 'no-sidebar';
}
return $classes;
}
add_filter( 'body_class', 'abchospitality_body_classes' );
/**
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
*/
function abchospitality_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '<link rel="pingback" href="%s">', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'abchospitality_pingback_header' );

View File

@ -0,0 +1,165 @@
<?php
/**
* Custom template tags for this theme
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package abchospitality
*/
if ( ! function_exists( 'abchospitality_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time.
*/
function abchospitality_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( DATE_W3C ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( DATE_W3C ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
/* translators: %s: post date. */
esc_html_x( 'Posted on %s', 'post date', 'abchospitality' ),
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
echo '<span class="posted-on">' . $posted_on . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if ( ! function_exists( 'abchospitality_posted_by' ) ) :
/**
* Prints HTML with meta information for the current author.
*/
function abchospitality_posted_by() {
$byline = sprintf(
/* translators: %s: post author. */
esc_html_x( 'by %s', 'post author', 'abchospitality' ),
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
);
echo '<span class="byline"> ' . $byline . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if ( ! function_exists( 'abchospitality_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function abchospitality_entry_footer() {
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'abchospitality' ) );
if ( $categories_list ) {
/* translators: 1: list of categories. */
printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', 'abchospitality' ) . '</span>', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'abchospitality' ) );
if ( $tags_list ) {
/* translators: 1: list of tags. */
printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', 'abchospitality' ) . '</span>', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link(
sprintf(
wp_kses(
/* translators: %s: post title */
__( 'Leave a Comment<span class="screen-reader-text"> on %s</span>', 'abchospitality' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);
echo '</span>';
}
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'abchospitality' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
),
'<span class="edit-link">',
'</span>'
);
}
endif;
if ( ! function_exists( 'abchospitality_post_thumbnail' ) ) :
/**
* Displays an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index views, or a div
* element when on single views.
*/
function abchospitality_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>
<div class="post-thumbnail">
<?php the_post_thumbnail(); ?>
</div><!-- .post-thumbnail -->
<?php else : ?>
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
<?php
the_post_thumbnail(
'post-thumbnail',
array(
'alt' => the_title_attribute(
array(
'echo' => false,
)
),
)
);
?>
</a>
<?php
endif; // End is_singular().
}
endif;
if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Shim for sites older than 5.2.
*
* @link https://core.trac.wordpress.org/ticket/12563
*/
function wp_body_open() {
do_action( 'wp_body_open' );
}
endif;