Skip to content

Instantly share code, notes, and snippets.

@VlaDeveloper
VlaDeveloper / functions.php
Created November 16, 2018 13:49
logo.php
function portfolio_widgets_init() {
register_sidebar( array(
'name' => 'Логотип SVG',
'id' => 'logo',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<span class="hidden">',
'after_title' => '</span>',
) );
}
@VlaDeveloper
VlaDeveloper / functions.php
Last active December 9, 2018 09:38
extra posts
add_action( 'init', 'register_post_types' );
function register_post_types(){
register_post_type('portfolio_about', array(
'label' => null,
'labels' => array(
'name' => 'Обо мне', // основное название для типа записи
'singular_name' => 'Информация обо мне', // название для одной записи этого типа
'add_new' => 'Добавить информацию обо мне', // для добавления новой записи
'add_new_item' => 'Добавление информации обо мне', // заголовка у вновь создаваемой записи в админ-панели.
'edit_item' => 'Редактирование информации обо мне', // для редактирования типа записи
@VlaDeveloper
VlaDeveloper / functions.php
Last active December 9, 2018 09:35
get extra posts
function getPortfolio(){
$posts = get_posts( array(
'orderby' => 'date',
'order' => 'ASC',
'post_type' => 'portfolio_port',
'numberposts' => -1 // remove limit
) );
$portfolio = [];
foreach($posts as $post){
$fields = get_fields($post->ID);
@VlaDeveloper
VlaDeveloper / index.php
Created November 16, 2018 13:59
get category by slug
<div class="col-12">
<?php
$idObj = get_category_by_slug('portfolio-port');
$id = $idObj->term_id;
?>
<h2><?php echo get_cat_name($id);?></h2>
</div>
@VlaDeveloper
VlaDeveloper / index.php
Last active November 16, 2018 14:02
show extra posts
<?php foreach(getContacts() as $contact): ?>
<div class="contact_item">
<div class="contact_item_title"><i class="fa fa-<?php echo $contact['icon']; ?>"></i> <?php echo $contact['title']; ?></div>
<div class="contact_item_content"><?php echo $contact['content']; ?></div>
</div>
<?php endforeach; ?>
@VlaDeveloper
VlaDeveloper / migx-sample.js
Created December 9, 2018 09:34 — forked from agragregra/migx-sample.js
MIGX Sample
Tabs:
[
{"caption":"Tab Title", "fields": [
{"field":"title","caption":"Name"},
{"field":"description","caption":"Description","inputTVtype":"textarea"},
{"field":"imageTV","caption":"Photo","inputTV":"imageTV"}
]}
]
Table:
@VlaDeveloper
VlaDeveloper / button.sass
Last active June 11, 2021 11:12 — 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
@VlaDeveloper
VlaDeveloper / _vars.sass
Created February 9, 2019 08:34
main transition
@mixin mt($t)
transition: all $t ease
@VlaDeveloper
VlaDeveloper / common.js
Created February 9, 2019 09:03
img svg to inline
$("img.img-svg").each(function(){var t=$(this),r=t.attr("id"),a=t.attr("class"),e=t.attr("src");$.get(e,function(e){var i=$(e).find("svg");void 0!==r&&(i=i.attr("id",r)),void 0!==a&&(i=i.attr("class",a+" replaced-svg")),!(i=i.removeAttr("xmlns:a")).attr("viewBox")&&i.attr("height")&&i.attr("width")&&i.attr("viewBox","0 0 "+i.attr("height")+" "+i.attr("width")),t.replaceWith(i)},"xml")});
[[getImageList?
&tvname=`some-item`
&tpl=`some-item`
&docid=`1`]]