<?php if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_type() ); //подключаем шаблон вывода постов
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );//подключаем шаблон если постов нету
endif;
?>
<?php echo get_field('кнопка_на_телефонах'); ?>
<?php echo get_field('кнопка_на_телефонах', 'option'); ?>
<?php echo get_field('кнопка_на_телефонах', $post_id); ?>
add_action('init', 'my_add_posts_types');
function my_add_posts_types(){
register_taxonomy('department', array('doctors'), array(
'label' => __('Department','my'),
'labels' => array(
'name' => __('Department','my'),
'singular_name' => __('Department','my'),
'search_items' => __('Search Department','my'),
'all_items' => __('All Departments','my'),
'parent_item' => __('Department','my'),
'parent_item_colon' => __('Department','my'),
'edit_item' => __('Edit Department','my'),
'update_item' => __('Department','my'),
'add_new_item' => __('Add Department','my'),
'new_item_name' => __('add Department','my'),
'menu_name' => __('Department','my'),
),
'description' => __('Department description','my'),
'public' => true,
'show_in_nav_menus' => false,
'show_ui' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array('slug'=>'department', 'hierarchical'=>false, 'with_front'=>false, 'feed'=>false ),
'show_admin_column' => true,
) );
register_post_type('doctors', array(
'labels' => array(
'name' => __('Doctors','my'),
'singular_name' => __('Doctor','my'),
'add_new' => __('Add doctor','my'),
'add_new_item' => __('Add doctor','my'),
'edit_item' => __('Edit doctor','my'),
'new_item' => __('New doctor','my'),
'view_item' => __('See doctor','my'),
'search_items' => __('Search doctor','my'),
'not_found' => __('Not found doctors','my'),
'not_found_in_trash' => __('Not found doctors','my'),
'parent_item_colon' => '',
'menu_name' => __('Doctors','my'),
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','author','thumbnail','excerpt','comments')
) );
}
add_shortcode( 'my_price_1', 'my_price_1' );
function my_price_1( ) {
$my_price = '';
$name = get_field('name_2', 'option');
$price = get_field('price_2', 'option');
$my_price .= '<table style="width:100%">';
$my_price .= '<tr> <td>'. $sub_name.'</td><td>'. $sub_price.'</td></tr>';
$my_price .= '</table>';
return $my_price;
}
define( 'WP_HOME', 'example.com' );
define( 'WP_SITEURL', 'example.com' );
if ( ! function_exists( 'underscore_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time.
*/
function underscore_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', 'vchuytheme' ),
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK.
}
endif;