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
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 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
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
<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
<?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
/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
CREATE TABLE results( | |
id INT NOT NULL AUTO_INCREMENT, | |
1sttitle VARCHAR(100) NOT NULL, | |
2ndtitle VARCHAR(100) NOT NULL, | |
3rdtitle VARCHAR(100) NOT NULL, | |
1stmsg VARCHAR(300) NOT NULL, | |
2ndmsg VARCHAR(300) NOT NULL, | |
3rdmsg VARCHAR(300) NOT NULL, | |
1stscore VARCHAR(100) NOT NULL, | |
2ndscore VARCHAR(100) NOT NULL, |
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
CREATE TABLE tutorials_tbl( | |
id INT NOT NULL AUTO_INCREMENT, | |
title VARCHAR(100) NOT NULL, | |
slug VARCHAR(40) NOT NULL, | |
content VARCHAR(2000) NOT NULL, | |
PRIMARY KEY ( id ) | |
) AUTO_INCREMENT=15110; |
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( $ ) { | |
$.fn.myPlugin = function() { | |
// Do your awesome plugin stuff here | |
}; | |
})( jQuery ); |