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
if ( $query->is_home() && $query->is_main_query() ) { | |
$posts_per_page = 8; | |
$page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 0; | |
$query->set( 'offset', 5 + $posts_per_page * $page ); | |
$query->set( 'posts_per_page', $posts_per_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
<?php | |
/** | |
* Primary Nav using Dropdown Walker | |
* | |
* @param array $args | |
* @return array | |
*/ | |
function be_primary_nav_dropdown( $args ) { | |
if( 'primary' !== $args['theme_location'] || !class_exists( 'Walker_Nav_Menu_Dropdown' ) ) |
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
/** | |
* Gamajo Accessible Menu. | |
* | |
* Improves menu accessibility in two ways: | |
* * Adds a delay to submenus disappearing when moving the mouse away. | |
* * Makes submenus appear when tabbing through menu items with the keyboard. | |
* | |
* Kudos to Rian Rietveld for the code on which this plugin is based. | |
* | |
* After enqueueing this file (or concatenating it with your theme JS file), |
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
// Save as: php-echo-open-html.sublime-snippet | |
<snippet> | |
<content><![CDATA[ | |
echo '<${1:div} ${2:class}="${3:value}">'; | |
]]></content> | |
<description>PHP echo statement with opening html tag with class</description> | |
<tabTrigger>phpechohtmlopen</tabTrigger> | |
<scope>source.php.embedded.block.html</scope> | |
</snippet> |
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 | |
/** | |
* Stop Skype from hijacking phone numbers | |
* | |
* Adds a META tag to the HTML document head, that | |
* prevents Skype from hijacking/over-writing phone | |
* numbers displayed in the Theme. | |
* | |
* @link http://www.wpbeginner.com/wp-tutorials/how-to-fix-skype-overwriting-phone-numbers-in-wordpress-themes/ H/T WPBeginner | |
*/ |
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 | |
namespace JPB; | |
function wp_insert_post_data( $data, $postarr ){ | |
if($data['foo'] !== 'bar' || $data['baz'] !== 'bat'){ | |
wp_redirect( add_query_arg( array( 'post' => $data['ID'], 'action' => 'edit', 'message' => 11 ), admin_url( 'post.php' ) ) ); | |
exit; | |
} | |
return $data; |
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 | |
remove_action( 'genesis_doctype', 'genesis_do_doctype' ); | |
add_action( 'genesis_doctype', 'child_do_doctype' ); | |
/** | |
* Include Facebook Open Social namespaces. | |
* | |
* @author Gary Jones | |
* @link http://code.garyjones.co.uk/modify-doctype/ | |
*/ |
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
# Here we're copying the trunk of one of my plugins, to a tag of 1.3.0, with a simple message. | |
svn copy https://plugins.svn.wordpress.org/genesis-admin-bar-plus/trunk https://plugins.svn.wordpress.org/genesis-admin-bar-plus/tags/1.3.0 -m "Release 1.3.0" |
OlderNewer