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
(?s)/\*.*?\*/ |
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
\/\/.* |
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('has_post_thumbnail')) && (has_post_thumbnail())) : ?> | |
<?php the_post_thumbnail('thumbnail'); ?> | |
<?php else :?> | |
<img src="<?php bloginfo('template_directory');?>/img/<?php $category = get_the_category(); echo $category[0]->cat_name; ?>.jpg" /> | |
<?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 // if inside the loop | |
if ( is_page( array(1, 2, 3) ) ) { ?> | |
<p>Conditional content to show</p> | |
<?php } else { }?> | |
<?php // if outside the loop | |
global $post; | |
if ( is_page('5') && $post->post_parent ) { ?> | |
<p>Conditional content to show</p> | |
<?php } else { }?> |
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 | |
// Custom loading image | |
add_filter('wpcf7_ajax_loader', 'my_wpcf7_ajax_loader'); | |
function my_wpcf7_ajax_loader () { | |
return get_bloginfo('stylesheet_directory') . '/img/ajax-loader.gif'; | |
} | |
?> |
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
div.wpcf7 { | |
margin: 0; | |
padding: 0; | |
} | |
div.wpcf7 input.wpcf7-text, div.wpcf7 textarea { | |
border: 1px solid #CCCCCC; | |
border-radius: 3px; | |
color: #555555; | |
display: inline-block; | |
font-size: 1em; |
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 | |
// Disable canonical redirect | |
add_filter('redirect_canonical', 'disable_redirect_canonical', 10, 2); | |
function disable_redirect_canonical($redirect_url, $requested_url) { | |
if (is_page('1')) { | |
return $requested_url; | |
} else { | |
return $redirect_url; | |
} | |
} |
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 // Display latest comments for each post on non-single page views | |
$comment_array = array_reverse(get_approved_comments($wp_query->post->ID)); | |
$count = 1; // Number of comments to display | |
if ($comment_array) { ?> | |
<h3><?php comments_number('No comment', '1 comment', '% comments'); ?></h3> | |
<ul> | |
<?php foreach ($comment_array as $comment) { | |
if ($count++ <= 2) { ?> | |
<li><?php comment_author_link(); ?>: <?php comment_excerpt(); ?></li> | |
<?php } |
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 | |
// Manual Wordpress FTP | |
define('FS_CHMOD_FILE', 0755); | |
define('FS_CHMOD_DIR', 0755); | |
define('FS_METHOD', 'ftpext'); | |
define('FTP_BASE', '/'); | |
define('FTP_CONTENT_DIR', '/wp-content/'); | |
define('FTP_PLUGIN_DIR ', '/wp-content/plugins/'); | |
define('FTP_USER', 'username'); | |
define('FTP_PASS', 'password'); |