Skip to content

Instantly share code, notes, and snippets.

David Perez davidperezgar

Block or report user

Report or block davidperezgar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View htaccess-301-redirection
<IfModule mod_rewrite.c>
RewriteEngine On
redirectMatch 301 ^(.*)$ http://www.$1
davidperezgar / footer.php
Created Apr 7, 2015
Placeholder for Wordpres login
View footer.php
davidperezgar / script-wrapper
Created Apr 15, 2015
Javascript Wrapper for Wordpress
View script-wrapper
<script type="application/javascript">
(function ($) {
davidperezgar / how-to-use-posts-2-posts
Created Apr 15, 2015
Posts 2 posts functions for WordPress
View how-to-use-posts-2-posts
//In functions .php
function my_connection_types() {
p2p_register_connection_type( array(
'name' => 'posts_to_pages',
'from' => 'post',
'to' => 'page'
) );
add_action( 'p2p_init', 'my_connection_types' );
davidperezgar / wp-oembed-defaults.php
Created Oct 28, 2015
Oembed dimensions defaults in Wordpress
View wp-oembed-defaults.php
function themename_embed_defaults($defaults) {
return $defaults;
davidperezgar / wp-config-snippet-debug.php
Created Nov 3, 2015
WP Debug Active to a file - Recommended for Woocommerce
View wp-config-snippet-debug.php
// Activate WP_DEBUG to a file
// file: /wp-content/uploads/debug.log
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
View media-queries-bootstrap
/*Media Queries*/
@media only screen and (min-width: 801px) and (max-width: 980px) {
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
@media only screen
davidperezgar / wordpress-font-awesome-ie7-cdn.php
Created Nov 16, 2015 — forked from robneu/wordpress-font-awesome-ie7-cdn.php
Add Font Awesome With IE7 Support to WordPress using a CDN
View wordpress-font-awesome-ie7-cdn.php
* Registers and loads font awesome
* CSS files using a CDN.
* @link
* @author FAT Media
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
davidperezgar / functions-disable-apperance.php
Created Nov 23, 2015
Disable Wordpress Appearance and Plugins for users
View functions-disable-apperance.php
//Disable Appearance and Plugins for users
function remove_menus(){
remove_menu_page( 'themes.php' ); //Appearance
remove_menu_page( 'plugins.php' ); //Plugins
add_action( 'admin_menu', 'remove_menus' );
davidperezgar / gist:6bb9d7f18b1ace430dbc
Created Dec 3, 2015 — forked from billerickson/gist:1493758
Gallery metabox - custom post types
View gist:6bb9d7f18b1ace430dbc
* Gallery Metabox - Only show on 'page' and 'rotator' post types
* @author Bill Erickson
* @link
* @link
* @since 1.0
* @param array $post_types
You can’t perform that action at this time.