Skip to content

Instantly share code, notes, and snippets.

/* Добавляем настройки шаблона */
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Настройки сайта',
'menu_title' => 'Настройки сайта',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
'redirect' => false
));
<ul class="nav navbar-nav navbar-right">
<?php wp_list_pages(array('title_li' => '')); ?>
</ul>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php
function wpbootstrap_scripts_with_jquery()
{
// Register the script like this for a theme:
// Регистрирум скрипт ('ИМЯ СКРИПТА','ПУТЬ К ФАЙЛУ СКРИПТА', ЗАВИСИТ ЛИ ОТ БИБЛИОТЕК );
wp_register_script( 'bootstrap', get_template_directory_uri() . '/vendor/bootstrap/js/bootstrap.min.js', array( 'jquery' ) );
wp_register_script( 'easing', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js');
wp_register_script( 'custom', get_template_directory_uri() . '/js/freelancer.min.js', array( 'jquery' ) );
// For either a plugin or a theme, you can then enqueue the script:
// Добавляем наши скрипты "в очередь", в ковычках имя зарегистрированного скрипта(см.выше)
/*
Theme Name: Rose
Theme URI: домашняя-страница-темы
Description: краткое-описание-темы
Author: ваше-имя
Author URI: ваш-URI
Template: напишите-здесь-наименование-родительской-темы--необязательное-поле
Version: номер-версии--необязательное-поле
.
Развёрнутое описание темы/Лицензия-если-нужно.
@sitecustom
sitecustom / how2wordpress
Created March 29, 2017 01:32 — forked from ivanmarkovich/how2wordpress
Посадка на WordPress
Порядок действий:
1) Установить WordPress
2) Зайти на URL сайта, выполнить установку WP ввести базу данных, логин, пароль
3) Перейти в /wp-content/themes/ и добавить папку со своей темой(сайтом)
4) Изменить расширение файла index.html на index.php
5) Создать файл style.css и прописать комментарий с описанием темы ( https://gist.github.com/ivanmarkovich/2a056172db4cc4c39827343222a00855 )
6) Перенести <link>'и со стилями из index.php в style.css, добавить их через @import
7) В файле index.php: подключить файл со стилями используя функцию php - <link href="<?php bloginfo('stylesheet_url');?>" rel="stylesheet">
8) В файле index.php: перенести все скрипты из подвала в тег head
9) Создать файл functions.php, в него перенести скрипты из head ( https://gist.github.com/ivanmarkovich/954e4cf068efb55211c9e58210d7952a )
@sitecustom
sitecustom / button.sass
Created March 27, 2017 23:29 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
<main class="cd-main-content">
<section class="center">
<h1>SVG Modal Window</h1>
<a href="#0" class="cd-btn" id="modal-trigger" data-type="cd-modal-trigger">Fire Modal Window</a>
</section>
</main> <!-- .cd-main-content -->
<div class="cd-modal" data-modal="modal-trigger">
<div class="cd-svg-bg"
data-step1="M-59.9,540.5l-0.9-1.4c-0.1-0.1,0-0.3,0.1-0.3L864.8-41c0.1-0.1,0.3,0,0.3,0.1l0.9,1.4c0.1,0.1,0,0.3-0.1,0.3L-59.5,540.6 C-59.6,540.7-59.8,540.7-59.9,540.5z"
<!-- Подключаем API Яндекс карт внутри тега head -->
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<!-- Создаем div с id map в теле документа bofy -->
<div id="map" style="width: 100%; height: 400px"></div>
<!-- Настраиваем карту через JavaScript -->
<script type="text/javascript">
//создаем переменные "Карта" и "Метка"
ymaps.ready(init);
@sitecustom
sitecustom / ToTop
Last active December 25, 2017 10:02 — forked from aislam23/ToTop
<div class="top" title="Наверх">
<i class="fa fa-angle-double-up" aria-hidden="true"></i>
</div>
.top
position: fixed
right: -100px
bottom: 25px
background-color: $accent
z-index: 12