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
<wpml-config> | |
<admin-texts> | |
<key name="theme_mods_yourtheme"> | |
<key name="option_name_1" /> | |
<key name="option_name_2" /> | |
</key> | |
</admin-texts> | |
</wpml-config> |
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 | |
// enables you to use example url "/showcase/case-title" and pushes it to "single-showcases.php" template for rendering | |
function mu_custom_rewrites() { | |
global $wp; | |
$wp->add_query_var('case'); | |
add_rewrite_tag('%case%', '([^/]+)', 'case='); |
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_filter( 'posts_where', 'start_with_letter', 10, 2 ); | |
function start_with_letter( $where, &$wp_query ) | |
{ | |
global $wpdb; | |
if ( $start_with_letter = $wp_query->get( 'start_with_letter' ) ) { | |
$where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'' . esc_sql( like_escape( $start_with_letter ) ) . '%\''; | |
} |
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 a different database with dbDelta | |
*/ | |
global $wpdb; | |
require_once( ABSPATH . 'wp-admin/includes/upgrade.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
jQuery(document).ready(function() { | |
if( jQuery("#order_note_type") ) { | |
jQuery('#order_note_type :nth-child(2)').prop('selected', 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 display_posts_function() { | |
$return = ""; | |
$cats = get_categories('hide_empty=0&orderby=name&order=asc'); | |
foreach ($cats as $cat) : |
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 | |
/* | |
* Want to get the previous post and next post data in WordPress? Use this in the loop | |
* get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy ) | |
*/ | |
$prev_post = get_adjacent_post( false, false, true ); // retrieves previous post in current post type, with no exclusions | |
$next_post = get_adjacent_post( false, false, false ); // retrieves next post in current post type, with no exclusions |
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 | |
/* | |
* Want to get the previous post and next post data in WordPress? Use this in the loop | |
* get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy ) | |
*/ | |
$prev_post = get_adjacent_post( false, false, true ); // retrieves previous post in current post type, with no exclusions | |
$next_post = get_adjacent_post( false, false, false ); // retrieves next post in current post type, with no exclusions |
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
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^wp-admin$ wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] |
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
import Cocoa | |
class thisOffice { | |
var currentUsers: Int | |
var totalSpaces : Int | |
init(currentUsers: Int, totalSpaces: Int) { | |
self.currentUsers = currentUsers | |
self.totalSpaces = totalSpaces |