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 ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<?php | |
the_title(); | |
the_content(); | |
?> | |
<?php endwhile; ?> | |
<?php endif; ?> |
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 | |
ini_set( 'display_errors', 1 ); | |
error_reporting( E_ALL ); | |
$from = "__email__"; | |
$to = "__email__"; | |
$subject = "PHP Mail Test script"; | |
$message = "This is a test to check the PHP Mail functionality"; | |
$headers = "From:" . $from; | |
mail($to,$subject,$message, $headers); | |
echo "Test email sent"; |
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
var inputFolder = Folder.selectDialog("Select a folder to process"); | |
var fileList = inputFolder.getFiles("*.jpg"); | |
for(var i=0; i<fileList.length; i++) { | |
var doc = open(fileList[i]); | |
if (doc.width !== doc.height) { // if document is not already square... | |
if (doc.width > doc.height) { // if width is greater... | |
doc.resizeCanvas(doc.width, doc.width) // use this value for both sides... | |
} else { // else use height for both sides... |
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 | |
$args = array( | |
//////Author Parameters - Show posts associated with certain author. | |
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters | |
'author' => '1,2,3', //(int) - use author id [use minus (-) to exclude authors by ID ex. 'author' => '-1,-2,-3,'] | |
'author_name' => 'luetkemj', //(string) - use 'user_nicename' (NOT name) | |
'author__in' => array(2, 6), //(array) - use author id (available with Version 3.7). | |
'author__not_in' => array(2, 6), //(array)' - use author id (available with Version 3.7). |
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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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 | |
$thumbnail_id = get_woocommerce_term_meta( $sub_category->term_taxonomy_id, 'thumbnail_id', true ); | |
$image = wp_get_attachment_url( $thumbnail_id ); |
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 | |
add_action('activated_plugin','my_save_error'); | |
function my_save_error() | |
{ | |
file_put_contents(dirname(__file__).'/error_activation.txt', ob_get_contents()); | |
} |
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
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' | |
killall Dock |
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 | |
$i = 0; // counter | |
$url = "http://www.banki.ru/xml/news.rss"; // url to parse | |
$rss = simplexml_load_file($url); // XML parser | |
// RSS items loop | |
print '<h2><img style="vertical-align: middle;" src="'.$rss->channel->image->url.'" /> '.$rss->channel->title.'</h2>'; // channel title + img with src |
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
$('.parallax').each(function () { | |
var bgobj = $(this).find('.bg'); // создаем объект | |
$(window).scroll(function () { | |
var yPos = -($(window).scrollTop() / bgobj.data('speed')); // вычисляем коэффициент | |
// Присваиваем значение background-position | |
var coords = 'center ' + yPos + 'px'; | |
// Создаем эффект Parallax Scrolling | |
bgobj.css({ backgroundPosition: coords }); | |
}); |
NewerOlder