Skip to content

Instantly share code, notes, and snippets.

@dvereshchagin
Last active September 19, 2017 08:28
Show Gist options
  • Save dvereshchagin/391533501274a86a34969ead2a12a698 to your computer and use it in GitHub Desktop.
Save dvereshchagin/391533501274a86a34969ead2a12a698 to your computer and use it in GitHub Desktop.
В style.css указать поля */ theme, title ,description, author, author URI, version
Указать в title заголвок <title <?php bloginfo('name'); ?>></title> <meta charset="<?php bloginfo('charset'); ?>">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<?php wp_head(); ?>
<?php wp_footer(); ?> для подключения бара
<?php esc_url(home_url('/<наимнование страницы>')); ?>
<?php the_permalink(); ?> для перехода по ссылке
<?php if(have_posts()) {
while(have_posts()) {
the_post();
}
}
///// MENU ////////
index.php
<?php
$args = array(
'theme_location' => 'primary',
)
wp_nav_menu($args);
?>
functions.php
<?php
function bw_theme_setup() {
register-nav_menus(array(
"primary" => __('Primary Menu'),
"footer" => ___('Footer Menu')
));
}
add_action('after-setup_theme','bw_theme_setup');
?>
function bussines_customize_register($wp_customize) {
// Banner Section
$wp_customize->add_section('banner',array(
'title' =>__('Banner','bussines'),
'description' => sprintf(__('Options for homepage banner','bussines')),
'priority' => 130
));
//Heading Setting
$wp_customize->add_setting('banner_heading',array(
'default' => _x('Banner Heading','bussines'),
'type' => 'theme_mod'
));
//Heading Control
$wp_customize->add_control('banner_heading',array(
'label' =>__('Heading','bussines'),
'section' => 'banner',
'priority' => 20
));
}
add_action('customize_register','bussines_customize_register');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment