Skip to content

Instantly share code, notes, and snippets.

SASS:
.mfp-ready .mfp-figure
opacity: 0
.mfp-zoom-in
.mfp-figure, .mfp-iframe-holder .mfp-iframe-scaler
opacity: 0
transition: all 0.3s ease-out
transform: scale(0.95)
&.mfp-bg, .mfp-preloader
opacity: 0
<!-- HTML -->
<a href="#" class="toggle-mnu hidden-lg"><span></span></a>
<!-- SASS -->
.toggle-mnu
display: block
width: 28px
height: 28px
margin-top: 14px
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
height: 40px;
width: 24px;
display: block;
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
@Stason4ik1986
Stason4ik1986 / WordPress get_tags
Last active May 24, 2017 10:09
WordPress get_tags
<?php
$tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<p>Tag: <a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> </p> ';
}
}
?>
<?php
$tags = wp_get_post_tags($post->ID);
@Stason4ik1986
Stason4ik1986 / WordPress query_posts
Last active February 19, 2016 14:14
WordPress query_posts
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php echo the_title(); ?>
<?php echo the_content(); ?>
<?php echo the_excerpt(); ?> //цитата
<?php echo get_the_date('j F Y');?>//date of post
<?php echo the_post_thumbnail(array(100, 100)); ?>
<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); echo $large_image_url[0]; ?> for PopUp
<?php echo get_post_meta( $post->ID, 'дополнительное поле в посте' , true ); ?> //get from theme_options
@Stason4ik1986
Stason4ik1986 / jQueryResize
Last active January 19, 2016 11:42
jQueryResize
function heightDetect() {
$('.main_head').css('height', $(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});