This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Breadcrumbs Custom Function | |
function domain_get_breadcrumbs() { | |
$text['home'] = esc_html__('Home','domain'); | |
$text['category'] = esc_html__('Archive','domain').' "%s"'; | |
$text['search'] = esc_html__('Search results','domain').' "%s"'; | |
$text['tag'] = esc_html__('Tag','domain').' "%s"'; | |
$text['author'] = esc_html__('Author','domain').' %s'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1> | |
<?php | |
if(is_category()) { | |
echo esc_html_e('Category: ', 'domain') . single_cat_title("", false); | |
} elseif(is_author()) { | |
echo esc_html_e('Author: ', 'domain') . get_the_author(); | |
} elseif(is_tag()) { | |
echo esc_html_e('Tag: ', 'domain') . single_tag_title("", false); | |
} elseif( is_search()) { | |
echo esc_html_e('Search for: ', 'domain') . get_search_query(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function domain_name_func() { | |
echo 'Text'; | |
} | |
add_action('domain_name_hook','domain_name_func', 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Створити каталог в папке plugins | |
Назвати його domain-core | |
Створити в ньому файл domain-core | |
До нього підключити робочі файли | |
<?php | |
/* | |
Plugin Name: domein core | |
Plugin URI: https://www.facebook.com/frontendercode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function domein_add_metabox() { | |
add_neta_box('car_metabox', esc_html__('Cars Settings','domein'), 'domeins_cars_metabox_html', 'cars'); | |
} | |
add_action('add_meta_boxes', 'domein_add_metabox'); | |
function domeins_cars_metabox_html(){ | |
$car_price = get_post_meta($post->ID, 'car_price', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function domain_paginate($query) { | |
$big = 999999999; | |
echo paginate_links( array( | |
'base' => str_replace($big, '%#%', esc_url( get_pagenum_link( $big ))), | |
'format' => '?paged=%#%', | |
'current' => max(1, get_query_var('paged')), | |
'total' => $query->max_num_paged, | |
)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
get_header(); | |
$term = get_term_by( 'slug', get_query_var('term'), get_query_var('taxonomy') ); | |
echo $term -> name; | |
?> | |
<div> | |
<?php if( have_posts() ) : while(have_posts() ) : the_post(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
finction domein_add_class_onli($classes, $item, $args) { | |
if(isset ($args-> add_li_class ) ) { | |
$classes[] = $args-> add_li_class; | |
} | |
return $classes; | |
} | |
add_filter('nav_menu_css_class', 'domein_add_class_onli', 1,3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpdocs_codex_book_init() { | |
$labels = array( | |
'name' => esc_html_x( 'Books', 'Post type general name', 'textdomain' ), | |
'singular_name' => esc_html_x( 'Book', 'Post type singular name', 'textdomain' ), | |
'menu_name' => esc_html_x( 'Books', 'Admin Menu text', 'textdomain' ), | |
'name_admin_bar' => esc_html_x( 'Book', 'Add New on Toolbar', 'textdomain' ), | |
'add_new' => esc_html__( 'Add New', 'textdomain' ), | |
'add_new_item' => esc_html__( 'Add New Book', 'textdomain' ), | |
'new_item' => esc_html__( 'New Book', 'textdomain' ), | |
'edit_item' => esc_html__( 'Edit Book', 'textdomain' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article <?php post_class(); ?> id="post-<?php the_ID; ?>" data-post-id='<?php the_ID(); ?>' > | |
<div><?php the_title(); ?> </div> | |
<div><?php the_exerpt(); ?> </div> | |
<a href="<?php the_permalink(); ?>"> esc_html_e('Read more','domein'); </a> | |
</article> |