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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /wordpress_clean/ | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /wordpress_clean/index.php [L] | |
</IfModule> |
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 breadcrumbs() { | |
if( ! is_home() ){ | |
global $post; | |
?> | |
<a href="<?php bloginfo( 'wpurl' ); ?>">Home</a> » | |
<?php $parent = $post->post_parent; | |
$parent_title = get_the_title( $parent ); | |
echo '<a href="'.get_permalink( $parent ) .'">' . $parent_title . ( '' ); ?> </a> » | |
<?php the_title( '' ); ?> |
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 create_rewrites() { | |
add_rewrite_rule( | |
'pamelding/([^/]+)/?$', | |
'index.php?pagename=pamelding&courseid=$matches[1]', | |
'top' | |
); | |
add_rewrite_rule( | |
'kursdetaljer/([^/]+)/([^/]+)/?$', | |
'index.php?pagename=kursdetaljer&courseid=$matches[1]', |
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
d.iframe.one("load", function () { | |
f = true; | |
if (g) { | |
e.resolveWith(d) | |
} else { | |
setTimeout(function () { | |
e.rejectWith(d, ["ready timeout"]) | |
}, d.sensitivity) | |
} | |
}); |
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 _custom_media = true, | |
_orig_send_attachment = wp.media.editor.send.attachment; | |
$('#myMediaArea').click(function(e) { | |
var send_attachment_bkp = wp.media.editor.send.attachment; | |
var button = $(this); | |
var id = button.attr('id').replace('_button', ''); | |
_custom_media = true; |
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 theme_rewrites( $wp_rewrite ) { | |
$rules = array( | |
'coordinates/([^/]+)/?$' => 'index.php?pagename=coordinates&coords=$matches[1]', | |
); | |
$wp_rewrite->rules = array_merge( $rules, $wp_rewrite->rules ); | |
} | |
add_action( 'generate_rewrite_rules', 'theme_rewrites' ); |
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 theme_custom_post_type() { | |
$labels = array( | |
'name' => _x( 'Clues', 'post type general name' ), | |
'singular_name' => _x( 'Clue', 'post type singular name' ), | |
'add_new' => _x( 'Add', 'book' ), | |
'add_new_item' => __( 'Add clue' ), | |
'menu_name' => __( 'Clues' ) | |
); | |
$args = array( |
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 for modifying the main query | |
*/ | |
function modify_the_loop( $query ) { | |
// Check that this is the main query, not a secondary one, and trigger if it's the author page' | |
if ( $query->is_main_query() && $query->is_author() ) | |
{ | |
$query->set( 'post_type', array( 'post', 'page', 'CPT', 'CPT2' ) ); | |
} | |
} |
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 my_post_check() | |
{ | |
if ( isset( $_POST['myslug-name'] ) ) | |
{ | |
Do form stuff here | |
} | |
} | |
add_action( 'init', 'my_post_check' ); |
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
$fetched = '21082013'; | |
date_default_timezone_set( 'UTC' ); | |
$date = DateTime::createFromFormat( 'dmY', $fetched ); | |
echo $date->format( 'Y-m-d' ); |
OlderNewer