This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| jQuery(window).load(function () { | |
| var container = document.querySelector('#container-of-items'); | |
| var myMasonry = new Masonry(container, { | |
| itemSelector: '.item', | |
| columnWidth: '.item', | |
| }); | |
| }); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = pavan.sss1991@gmail.com | |
| [core] | |
| editor = vim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| excludesfile = ~/.gitignore | |
| [sendemail] | |
| smtpencryption = tls | |
| smtpserver = smtp.gmail.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.exists = function() { | |
| return $(this).length; | |
| } | |
| // Example: | |
| if( $("#findID").exists() ) { | |
| // exists | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function customFunction(id) { | |
| console.log(id); | |
| } | |
| function get_id_user_login(){ | |
| FB.api( | |
| '/me', | |
| {fields:'id'}, | |
| function(response){ customFunction(response.id); } | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <title>Photos with Friends!</title> | |
| <script src="http://code.jquery.com/jquery-1.9.0.min.js"></script> | |
| <script> | |
| /** | |
| * This is the getPhoto library | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get current taxonomy-slug in template taxonomy-{taxonomy}.php | |
| $term = get_term_by('slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); | |
| echo $term->slug; | |
| // get full info of taxonomy | |
| $the_tax = get_taxonomy( get_query_var( 'taxonomy' ) ); | |
| echo $the_tax->labels->name; | |
| // get taxonomy-type current | |
| echo get_query_var('taxonomy'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //====================================================================================================================== | |
| // Google Maps Scripts <div id="acf-map" data-lat="12.345678" data-lng="12.345678"></div> | |
| //====================================================================================================================== | |
| function render_map($map_div) { | |
| // var | |
| var lat = $map_div.attr('data-lat'); | |
| var lng = $map_div.attr('data-lng'); | |
| // coordinates to latLng | |
| var latlng = new google.maps.LatLng(lat, lng); | |
| // map Options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get_post_by_slug($slug, $post_type){ | |
| $posts = get_posts(array( | |
| 'name' => $slug, | |
| 'posts_per_page' => 1, | |
| 'post_type' => $post_type, | |
| 'post_status' => 'publish' | |
| )); | |
| if( !$posts ) { | |
| throw new Exception("NoSuchPostBySpecifiedID"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //WordPress has a few useful options, you can get the homepage ID by using the following: | |
| $frontpage_ID = get_option('page_on_front'); | |
| //or the Blog ID by using: | |
| $blog_ID = get_option('page_for_posts'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //For the latest blog post: | |
| <?php query_posts('showposts=1'); ?> | |
| <?php while (have_posts()) : the_post(); ?> | |
| <?php the_post_thumbnail(); ?> | |
| <?php endwhile; ?> | |
| //For a thumbnail from a particular page (in this case id =7 ): | |
| <?php query_posts('page_id=7'); ?> | |
| <?php while (have_posts()) : the_post(); ?> | |
| <?php the_post_thumbnail(); ?> |