View functions.php
add_action( 'after_setup_theme', 'theme_register_nav_menu' ); | |
function theme_register_nav_menu() { | |
register_nav_menu( 'primary', 'Primary Menu' ); | |
} |
View Подключение скриптов
add_action( 'wp_enqueue_scripts', 'theme_add_scripts' ); | |
function theme_add_scripts() { | |
//add scripts | |
wp_enqueue_script( 'main-js', get_template_directory_uri() .'/js/build.js', array('jquery'), '1.0', true ); | |
//add style | |
wp_enqueue_style( 'main-style', get_template_directory_uri() .'/css/main.css'); | |
} |
View functions.php
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_page(); | |
} |
View functions.php
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_page(); | |
} |
View style.css
/* | |
Theme Name: La Strada | |
Theme URI: http://alscon-web.com | |
Author: Alex Lavihyn | |
Author URI: https://www.upwork.com/freelancers/~015d44c720e5f4462a | |
Description: Theme for the restaurant La Strada city Kharkiv | |
Version: 1.0 | |
*/ |
View functions.php
// Filter output menu add sign in / sign out | |
add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 ); | |
function add_loginout_link( $items, $args ) { | |
if (is_user_logged_in() && $args->theme_location == 'header_menu') { | |
$items .= '<li><a href="'. wp_logout_url(home_url()) .'"><i class="icon-user-login-button"></i><span>Выйти</span></a></li>'; | |
} | |
elseif (!is_user_logged_in() && $args->theme_location == 'header_menu') { | |
$items .= '<li><a data-fancybox="" data-animation-duration="700" data-src="#register-popup" href="javascript:;"><i class="icon-Registration-01"></i><span>Регистрация</span></a></li>'; | |
$items .= '<li><a data-fancybox="" data-animation-duration="700" data-src="#login-popup" href="javascript:;"><i class="icon-user-login-button"></i><span>Войти</span></a></li>'; | |
} |
View .htaccess
# BEGIN WordPress | |
#Order Allow,Deny | |
#Deny from all | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
View terms-page.php
<?php | |
/** | |
* Template Name: Terms Page | |
*/ | |
?> |
View functions.php
add_filter('excerpt_more', function($more) { | |
return '...'; | |
}); |
NewerOlder