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
/applications/MAMP/library/bin/mysql -u root -p wordpress_db < /Applications/MAMP/htdocs/backupDB.sql |
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
<?php if (have_posts()) : | |
$i=0; // counter | |
while(have_posts()) : the_post(); | |
if($i%3==0) { // if counter is multiple of 3, put an opening div ?> | |
<!-- <?php echo ($i+1).'-'; echo ($i+3); ?> --> | |
<div class="cf"> | |
<?php } ?> | |
<div class="col3 toolbox"> | |
<div class="head"> | |
<h5 style="text-align:center;"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h5> |
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
<title><?php | |
if( is_home() ){ | |
echo 'Art of Blog - The Art of How to Start and Run a Blog'; | |
} | |
else if ( is_category() ) { | |
$category = get_the_category(); | |
echo $category[0]->cat_name . ' | Optiniche'; | |
} | |
else { | |
single_post_title() .' | Art of Blog'; |
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
input,textarea { | |
font-size: 1em; | |
margin-bottom: 1em; | |
border-radius: 4px; | |
} | |
input[type="text"] { | |
margin-right: .5em; | |
} |
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 sidebar_shortcode() { | |
$output = '<div class="viral-sidebar">'; | |
ob_start(); | |
dynamic_sidebar( 'sidebar_shortcode' ); | |
$output .= ob_get_contents(); | |
ob_end_clean(); | |
$output .= '</div>'; | |
return $output; | |
} | |
add_shortcode('viral_sidebar', 'sidebar_shortcode'); |
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
add_action('template_redirect', 'audience_intel_add_js'); | |
function audience_intel_add_js() { | |
// enqueue script | |
wp_enqueue_script( 'audience_intel_js', | |
plugins_url( 'js/script.js' , __FILE__ ), | |
array('jquery'), audience_intel_version, true | |
); | |
// Get current page protocol | |
$protocol = isset( $_SERVER["HTTPS"] ) ? 'https://' : 'http://'; |
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 top_comment_authors($amount = 5){ | |
global $wpdb; | |
$results = $wpdb->get_results(' | |
SELECT | |
COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url | |
FROM | |
'.$wpdb->comments.' | |
WHERE |
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
sudo rsync -arv -e "ssh" --rsync-path="sudo rsync" user@host:/home /backup |
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
git init - "Self explanatory" | |
git remote add origin [git_url] - "Adds a remote repository named origin" | |
git add . - "Add files you want to commit" | |
git add -u - "Will remove deleted files from git" | |
git commit -m 'your message' - "Commit with a message" | |
git push origin master - "Push repository to Github" | |
git update-index --assume-unchanged [[path]] - Will ignore file from git unless explicitly added | |
git reset --soft HEAD^ - Deletes last commit and keeps any code changes | |
git commit --amend --reuse-message HEAD |
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
$(".downloadLink").click( | |
function(e) { | |
e.preventDefault(); | |
//open download link in new page | |
window.open( $(this).attr("href") ); | |
//redirect current page to success page | |
window.location="www.example.com/success.html"; | |
window.focus(); |