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
// Wordpress Header Image - Allows you to use the wordpress header GUI to add banners in your theme. | |
<?php if ( get_header_image() ) : ?> | |
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a> | |
<?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
$('img.swap').click(function() { | |
var src = ($(this).attr('src')); | |
var swap = ($(this).data('swap')); | |
$(this).attr('src', swap ); | |
$(this).data('swap', src ); | |
}); | |
// <img src="images/pic1.jpg" data-swap="images/pic2.jpg" class="swap"> |
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
a[href="gallery/gallery$.jpg" rel="gallery"]*10>img[src="gallery/gallery$.jpg" alt="Gallery Image"] | |
Sample Ouput: | |
<a href="gallery/gallery1.jpg" rel="shadowbox"><img src="gallery/gallery1.jpg" alt="Gallery Image"></a> | |
<a href="gallery/gallery2.jpg" rel="shadowbox"><img src="gallery/gallery2.jpg" alt="Gallery Image"></a> | |
<a href="gallery/gallery3.jpg" rel="shadowbox"><img src="gallery/gallery3.jpg" alt="Gallery Image"></a> | |
<a href="gallery/gallery4.jpg" rel="shadowbox"><img src="gallery/gallery4.jpg" alt="Gallery Image"></a> | |
<a href="gallery/gallery5.jpg" rel="shadowbox"><img src="gallery/gallery5.jpg" alt="Gallery Image"></a> |
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 $my_query = new WP_Query( 'posts_per_page=3' ); | |
while ( $my_query->have_posts() ) : $my_query->the_post(); | |
$do_not_duplicate = $post->ID; ?> | |
<div class="entry"> | |
<h3><?php the_title(); ?></h3> | |
<?php the_excerpt(); ?> | |
<a class="readmore" href="<?php the_permalink(); ?>">Read more »</a> | |
</div> | |
<?php endwhile; ?> |
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
// Remove the admin bar from the front end | |
add_filter( 'show_admin_bar', '__return_false' ); |
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
<h1>Sitemap</h1> | |
[menu name="Sitemap"] | |
/* Create shortcode to generate menu list in post */ | |
/* Shortcode: [menu name="name-of-menu"] */ | |
function print_menu_shortcode($atts, $content = null) { | |
extract(shortcode_atts(array( 'name' => null, ), $atts)); | |
return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) ); | |
} |
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
/*The following will elimiate the padding in the extra content section*/ | |
#page.content { | |
padding: 0px; | |
} |
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
/* Sometimes we need to execute PHP scripts in text widget but by default WordPress doesn’t allow this feature because of | |
security issues. | |
Find the functions.php file of your current theme and add the following code at the end of the file. | |
*/ | |
function php_execute($html){ | |
if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html); | |
$html=ob_get_contents(); | |
ob_end_clean(); | |
} |
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
/* Make the trailing 3d shadow on top navigations using CSS*/ | |
.nav li { | |
content: ""; | |
width: 0px; | |
height: 0px; | |
position: absolute; | |
bottom: -10px; | |
left: 0px; | |
border-width: 5px 5px 5px 5px; | |
border-style: solid; |
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
// reviews widget provided by customer | |
function shortcodenamehere_function() { | |
$text = <<<TEXT | |
(Insert any code here) | |
TEXT; | |
return $text; | |
} | |
add_shortcode('shortcodenamehere', 'shortcodenamehere_function'); | |
// end shortcode creator |
OlderNewer