Skip to content

Instantly share code, notes, and snippets.

View f4rr3ll1990's full-sized avatar

F4rr3LL f4rr3ll1990

View GitHub Profile
<?php
$custom_fields = get_post_custom($post->ID);
foreach ( $custom_fields as $field_key => $field_values ) {
if(!isset($field_values[0])) continue;
if(in_array($field_key,array("_edit_lock", "_edit_last", "_thumbnail_id"))) continue;
echo "<strong>$field_key:</strong> $field_values[0] <br>";
}
show_admin_bar(false);
add_theme_support('post-thumbnails');
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
<!-- HTML -->
<a href="#" class="toggle-mnu hidden-lg"><span></span></a>
<!-- CSS -->
body {
background-color: #333;
}
.toggle-mnu {
display: block;
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
height: 40px;
width: 24px;
display: block;
@f4rr3ll1990
f4rr3ll1990 / wp_post-thumbnail.php
Created June 24, 2017 21:54
WordPress Post Thumbnail URL
<?php $url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url = $url['0']; ?>
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
<? endwhile; endif; wp_reset_query(); ?>
#loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 9999;
@f4rr3ll1990
f4rr3ll1990 / animate-css.js
Created June 24, 2017 22:18
Animate CSS + WayPoints javaScript Plugin | https://daneden.github.io/animate.css/
//Animate CSS + WayPoints javaScript Plugin
//Example: $(".element").animated("zoomInUp", "zoomOutDown");
//Author URL: http://webdesign-master.ru
(function($) {
$.fn.animated = function(inEffect, outEffect) {
$(this).css("opacity", "0").addClass("animated").waypoint(function(dir) {
if (dir === "down") {
$(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
} else {
$(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
<?php
$idObj = get_category_by_slug('Имя Категории');
$id = $idObj->term_id;
if ( have_posts() ) : query_posts('cat=' . $id);
while (have_posts()) : the_post(); ?>
<?php echo get_post_meta($post->ID, 'Имя доп поля', true); ?>
<? endwhile; endif; wp_reset_query(); ?>
<!-- Луп из поста по ID -->
<?php
$post_id_1 = get_post( 1 );
$title = $post_id_1->post_title;
$content = $post_id_1->post_content;
$excerpt = $post_id_1->post_excerpt;
if (has_post_thumbnail( $post->ID ) ):
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
?>