This file contains 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
<h2><a href='<?php the_permalink() ?>'><?php the_title() ?></a></h2> | |
<div class="content"> | |
<?php the_excerpt() ?> | |
</div> |
This file contains 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
if it is before 10am { | |
<h1>Good Morning</h1> | |
} | |
if it is after 6pm { | |
<h1>Good Evening</h1> | |
} | |
otherwise { | |
<h1>Good Day</h1> | |
} |
This file contains 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
// actions when the user starts the selection | |
$('.entry-content').mousedown(function (event) { | |
// take the position of the mouse where the user starts the selection | |
// we need this for showing the share button in the middle of the selection | |
$('body').attr('mouse-top',event.clientY+window.pageYOffset); //-> sets up the top value as attribute on body tag. | |
$('body').attr('mouse-left',event.clientX); //-> sets up the left value as attribute on body tag. | |
// remove share button and the old selection - ! Just if the user clicks the left button of the mouse. For right click we must show the genuine browser menu. | |
if(!getRightClick(event) && getSelectionText().length > 0) { | |
$('.twtshare').remove(); //-> remove share button |
This file contains 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
<?php | |
$img_src = wp_get_attachment_image_url( $attachment_id, 'medium' ); | |
$img_srcset = wp_get_attachment_image_srcset( $attachment_id, 'medium' ); | |
?> | |
<img src="<?php echo esc_url( $img_src ); ?>" | |
srcset="<?php echo esc_attr( $img_srcset ); ?>" | |
sizes="(max-width: 50em) 87vw, 680px" alt="A rad wolf"> | |
This file contains 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
<?php | |
if( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array ( | |
'key' => 'group_56474888a8e7f', | |
'title' => 'Attachment Options', | |
'fields' => array ( | |
array ( | |
'key' => 'field_56474b42cc2ed', |
This file contains 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
$token = get_transient( 'twitter_access_token' ); | |
$token = ( empty( $token ) ) ? get_twitter_access_token() : $token; | |
$request = wp_remote_get('https://api.twitter.com/1.1/followers/ids.json?screen_name=danielpataki&count=5', array( | |
'headers' => array( | |
'Authorization' => 'Bearer ' . $token, | |
'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' | |
), | |
'httpversion' => '1.1' | |
)); | |
$token = json_decode( $request['body'] ); |
This file contains 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
public function get_remote_posts() { | |
$posts = get_transient( 'remote_posts' ); | |
if( empty( $posts ) ) { | |
$response = wp_remote_get( 'http://mysite.com/wp-json/wp/v2/posts/' ); | |
if( is_wp_error( $response ) ) { | |
return array(); | |
} | |
$posts = json_decode( wp_remote_retrieve_body( $response ) ); |
This file contains 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 td_admin_assets() { | |
wp_enqueue_style( 'td-admin-post-list', get_stylesheet_directory_uri() . '/admin-style.css', false, '1.0.0' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'td_admin_assets' ); |
This file contains 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
$countries = array("Afghanistan" => "Afghanistan", "Albania" => "Albania", "Algeria" => "Algeria", "American Samoa" => "American Samoa", "Andorra" => "Andorra", "Angola" => "Angola", "Anguilla" => "Anguilla", "Antarctica" => "Antarctica", "Antigua and Barbuda" => "Antigua and Barbuda", "Argentina" => "Argentina", "Armenia" => "Armenia", "Aruba" => "Aruba", "Australia" => "Australia", "Austria" => "Austria", "Azerbaijan" => "Azerbaijan", "Bahamas" => "Bahamas", "Bahrain" => "Bahrain", "Bangladesh" => "Bangladesh", "Barbados" => "Barbados", "Belarus" => "Belarus", "Belgium" => "Belgium", "Belize" => "Belize", "Benin" => "Benin", "Bermuda" => "Bermuda", "Bhutan" => "Bhutan", "Bolivia" => "Bolivia", "Bosnia and Herzegowina" => "Bosnia and Herzegowina", "Botswana" => "Botswana", "Bouvet Island" => "Bouvet Island", "Brazil" => "Brazil", "British Indian Ocean Territory" => "British Indian Ocean Territory", "Brunei Darussalam" => "Brunei Darussalam", "Bulgaria" => "Bulgaria", "Burkina Faso" => "Burkina Faso", "Burund |
This file contains 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
add_shortcode( 'map', 'mgms_map' ); | |
function mgms_map( $args ) { | |
$id = substr( sha1( "Google Map" . time() ), rand( 2, 10 ), rand( 5, 8 ) ); | |
return "<div class='map' id='map-$id'></div>"; | |
} |