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 | |
// Add class to links generated by next_posts_link and previous_posts_link, | |
// see https://css-tricks.com/snippets/wordpress/add-class-to-links-generated-by-next_posts_link-and-previous_posts_link/ | |
add_filter('next_posts_link_attributes', 'posts_link_attributes'); | |
add_filter('previous_posts_link_attributes', 'posts_link_attributes'); | |
function posts_link_attributes() { | |
return 'class="button"'; | |
} |
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 | |
// add blog_ID class to the body tag, see http://zurb.com/forrst/posts/Wordpress_multisite_blog_class-dAb | |
add_action( 'body_class', 'wpmu_body_class' ); | |
function wpmu_body_class( $class ) { | |
global $current_blog; | |
$class[] = 'site-lang-' . $current_blog-> blog_id; | |
return $class; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" type="text/css" href="styles.css"> | |
</head> | |
<body> | |
<h1>Flexbox</h1> | |
<p>Test</p> |
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 { | |
max-width: 100%; | |
height: auto; | |
} | |
img [src$=".svg"] { | |
max-width: auto; | |
width: 100%; | |
height: auto; | |
} |
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 global $blog_id; ?> | |
<?php if( $blog_id == '1' /* Blog 1 */) { ?> | |
<p>Blog 1</p> | |
<?php } else if( $blog_id == '2' /* Blog 2 */) { ?> | |
<p>Blog 2</p> | |
<?php } else if( $blog_id == '3' /* Blog 3 */) { ?> | |
<p>Blog 3</p> | |
<?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 if(is_page('xy')) { ?> | |
// do something on the xy page | |
<?php } ?> | |
<?php if(!is_page('xy')) { ?> | |
// do something on every but the yx page | |
<?php } ?> | |
<?php if(is_page('xy') || is_page('xyz') ) { ?> | |
// do something on the xy and xyz page |
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
<!-- Environment --> | |
<?php if ($_SERVER['SERVER_ADDR']=="192.168.100.10"){ ?> | |
<!-- local, do something... --> | |
<?php } else { ?> | |
<!-- online, do something else... --> | |
<?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
// changing default wordpres email settings | |
add_filter('wp_mail_from', 'new_mail_from'); | |
add_filter('wp_mail_from_name', 'new_mail_from_name'); | |
function new_mail_from($old) { | |
return '[email protected]'; | |
} | |
function new_mail_from_name($old) { | |
return 'MAP BioPharma'; | |
} |
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
<!-- load a random image --> | |
<figure> | |
<img src="/images/visual-<?php echo(rand(1,5)); ?>" /> | |
</figure> | |
<!-- Display random snippet --> | |
<?php | |
$snippet[] = '<h2>Snippet 1</p>'; |