Skip to content

Instantly share code, notes, and snippets.

View sarvar's full-sized avatar

Sarvar sarvar

  • Uzbekistan, Tashkent
View GitHub Profile
@sarvar
sarvar / same-height.css
Created June 25, 2017 05:40
How can I make Bootstrap columns all the same height?
Solution 1 using negative margins (doesn't break responsiveness)
.row{
overflow: hidden;
}
[class*="col-"]{
margin-bottom: -99999px;
padding-bottom: 99999px;
}
@sarvar
sarvar / ifcondition.php
Created July 5, 2017 04:16
If condition by status
<?php
global $post;
global $property_meta_data, $property_data,$hide_property_fields;
$location_dropdowns = ere_get_option('location_dropdowns',1);
$property_location = get_post_meta( $property_data->ID, ERE_METABOX_PREFIX . 'property_location', true );
$property_map_address = isset($property_location['address']) ? $property_location['address'] : '';
list( $lat, $long ) = isset($property_location['location']) ? explode( ',', $property_location['location'] ) : array('', '');
$property_item_status = wp_get_post_terms( $post->ID, 'property-status' );
@sarvar
sarvar / disable-plugin.php
Created July 6, 2017 08:06
Disable update notification for individual plugins
function filter_plugin_updates( $value ) {
unset( $value->response['akismet/akismet.php'] );
return $value;
}
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
@sarvar
sarvar / footer.js
Created July 16, 2017 13:17
Twitter Bootstrap 3 Sticky Footer
@sarvar
sarvar / bmodal.txt
Created July 18, 2017 08:38
ACF repeater fields in bootstrap modal to open images from thumbnails
<?php if(get_field( 'repeater_name')): ; ?>
<?php $i=0; while(has_sub_field( 'repeater_name')):; ?>
<div class="row university">
<div class="col-sm-12 title-block">
<h2><?php the_sub_field('sub_field_one'); ?></h2>
<p class="date"><?php the_sub_field('sub_field_two'); ?></p>
</div>
<div class="col-sm-12">
<div class="zoom-wrap"><a class="btn" data-toggle="modal" data-target="#myModal-<?php echo $i; ?>"><img class="img-responsive univ-thumb" src="<?php the_sub_field('sub_field_thumbnail'); ?>" alt=""/><br/><i class="fa fa-search-plus"></i> Enlarge image</a></div>
<!-- Modal -->
@sarvar
sarvar / fixed-footer.html
Created July 27, 2017 14:40
Фиксированный подвал
@sarvar
sarvar / fixed-footer.html
Created July 27, 2017 15:46
Прибитый к низу футер своими руками
@sarvar
sarvar / even-odd.php
Created August 6, 2017 09:34
Loop for even odd post wordpress
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $loop = new WP_Query( array('post_type' => 'portfolio', 'posts_per_page' => -1, 'order' => 'desc' ) ); ?>
<?php
$post_count = 0;
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php
if ($post_count++ % 2 == 0): ?>
<section class="section section-secondary animated animated-left animated-in">
<div class="shell extended">
@sarvar
sarvar / wordpress-proxy.php
Created August 30, 2017 10:54
Using WordPress Behind a Proxy
/* Configure proxy Server: add this to wp-config.php */
define('WP_PROXY_HOST', '172.17.9.112');
define('WP_PROXY_PORT', '3128');
define('WP_PROXY_USERNAME', '');
define('WP_PROXY_PASSWORD', '');
define('WP_PROXY_BYPASS_HOSTS', 'localhost');
@sarvar
sarvar / post-id.php
Created October 11, 2017 14:21
Wordpress post id
<div id="book-<?php the_ID(); ?>"></div>