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 | |
ob_start(); | |
the_content(''.__('Read more <span class="meta-nav">»</span>', 'sandbox').''); | |
$old_content = ob_get_clean(); | |
$new_content = strip_tags($old_content, '<img><p><b><br /><input><form><img><textarea><li><ol><ul><table>'); | |
echo $new_content; | |
?> |
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
function remove_menus () { | |
global $menu; | |
$restricted = array(__('Posts'), __('Links'), __('Pages'), __('Comments') ); | |
end ($menu); | |
while (prev($menu)){ | |
$value = explode(' ',$menu[key($menu)][0]); | |
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);} | |
} | |
} | |
add_action('admin_menu', 'remove_menus'); |
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
add_filter( 'pre_get_posts', 'my_get_posts' ); | |
function my_get_posts( $query ) { | |
if ( is_home() ) | |
$query->set( 'post_type', array( 'ale' ) ); | |
return $query; | |
} |
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 (has_post_thumbnail( $post->ID )) | |
{ | |
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'large', true); | |
echo '<div class="news-thumb" style="background-image: url(' . $image_url[0] . ')"></div>'; | |
} | |
else | |
{ | |
echo '<div class="news-thumb" style="background-image: url('. get_bloginfo('template_directory') .'/images/logo-footer.png)"></div>'; | |
} |
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( | |
'post_type'=> 'work' | |
); | |
query_posts( $args ); | |
// The Loop | |
while ( have_posts() ) : the_post(); | |
echo '<li>'; |
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 | |
include($_SERVER['DOCUMENT_ROOT']."/practical-property/parts/footer.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 | |
query_posts( array( 'post_type' => 'discography', 'recordings' => 'live' ) ); | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
?> | |
<h3><?php the_title(); ?></h3> | |
<?php the_content(); ?> | |
<?php endwhile; endif; wp_reset_query(); ?> |
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
// left: 37, up: 38, right: 39, down: 40, | |
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 | |
var keys = [37, 38, 39, 40]; | |
function preventDefault(e) { | |
e = e || window.event; | |
if (e.preventDefault) | |
e.preventDefault(); | |
e.returnValue = 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
<img alt="..." src="images/logo.svg" onerror="this.onerror=null; this.src='images/logo.png'"/> |
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
// add a new logo to the login page | |
function login_logo() { ?> | |
<style type="text/css"> | |
.login #login h1 a { | |
background-image: url( '<?php bloginfo('template_url') ?>/img/logo.png' ); | |
background-size: 300px auto; | |
height: 50px; | |
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader( | |
src='<?php bloginfo('template_url') ?>/img/logo.png', | |
sizingMethod='scale'); |