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
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
B myObj = new B(); | |
// comment the next line to disable parent constructor | |
myObj.Initialize(); | |
} |
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 | |
$using_ssl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_PORT'] == 443; | |
add_action('wp', 'check_ssl'); | |
function check_ssl() | |
{ | |
// Page ID 2 must be https | |
if (is_page(2) && !$using_ssl) | |
{ | |
header('HTTP/1.1 301 Moved Permanently'); |
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 session_start(); ?> | |
<form action="" method="post"> | |
<div> | |
<label>Old list name</label> | |
<input type="text" name="list_name" <?php if (isset($_SESSION['list_name'] )) echo 'value="' . $_SESSION['list_name'] . '"'; ?> | |
</div> | |
<div> | |
<label>New list name</label> |
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
jQuery(document).ready(function( $ ) | |
{ | |
var i = 1; | |
$('nav li').each(function() | |
{ | |
$(this).addClass('item_' + i ); | |
i++; | |
}); | |
}); |
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 | |
/** | |
* Insert this code inside your functions.php file. Do not have the opening <?php tag, as this should | |
* already exist at the top of your functions file. | |
* | |
* USAGE: If you have firstname as a variable in your page's URL (e.g. http://mydomain.com?firstname=Martyn) | |
* then putting [get var=firstname] into a WordPress post type or widget would print "Martyn" to the screen. | |
* After using exec PHP plugins for months (i.e. <?php echo $_GET['firstname']; ?>) I'm moving away from | |
* executing PHP directly in posts/pages and widegets. This is the whole reason shortcodes were invented in the |
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 | |
/** | |
* Instead of calling get_the_content(), call this function instead, and it'll all be good | |
*/ | |
function get_the_content_with_formatting() | |
{ | |
ob_start(); | |
the_content(); | |
$the_content = ob_get_contents(); |
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 | |
/** | |
* The Quotes Collection plugin, downloadable at http://wordpress.org/plugins/quotes-collection/, | |
* is a great plugin. I've used it on a couple of client sites and it's simple to use. | |
* However, there exists one little problem. If you want to show more than one quote | |
* on a page, and you want those quotes to be different every time, there's no way to do | |
* that. Replace the quotescollection_get_quote() function in quotes-collection.php with | |
* my modified version below. Specifically, this guarantees that the quotes are truly random, | |
* and that once served on a page, you will not get the same quote again. To prove this in |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> | |
<head profile="http://gmpg.org/xfn/11"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>1990s navigation (!)</title> | |
</head> | |
<body> | |
<script type="text/javascript" language="javascript"> | |
function toggle( resource ) { |
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 | |
function z_get_taxonomy( $var ) | |
{ | |
extract( shortcode_atts( array( | |
'name' => '' | |
), $var ) ); | |
$postID = get_the_ID(); | |
if ( ! empty( $name ) ) | |
{ |
OlderNewer