Skip to content

Instantly share code, notes, and snippets.

View fernandiez's full-sized avatar

Fernan fernandiez

View GitHub Profile
@fernandiez
fernandiez / wpbilbao-plugins
Created March 13, 2015 02:00
WordPress Bilbao #wpbilbao @ Plugins Básicos + Debate abierto - Créditos
WordPress Bilbao #wpbilbao @ Plugins Básicos + Debate abierto
-------------------------------------------------------------
http://www.wpbibao.es
http://www.meetup.com/WordPress-Bilbao/
https://twitter.com/wpbilbao
https://wpes.slack.com/
Enlace post
-----------
http://www.fernan.com.es/plugins-basicos-wordpress/
@fernandiez
fernandiez / page-manual-excerpts.php
Created July 13, 2015 21:42
Activate manual excerpts on WordPress pages
<?php // remove this line
//* Activate Manual excerpt on Pages
add_post_type_support('page', 'excerpt');
@fernandiez
fernandiez / update-domain.php
Created July 15, 2015 13:43
SQL update to change domain name in WordPress database
// SQL update to change domain name in WordPress database
// wp_options
UPDATE wp_options SET option_value = REPLACE (option_value, 'demo.domain.com', 'www.domain.com');
// wp_postmeta
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'demo.domain.com', 'www.domain.com');
// wp_options
UPDATE wp_posts SET post_content = REPLACE (post_content, 'demo.domain.com', 'www.domain.com');
@fernandiez
fernandiez / soliloquy-slider-wordpress-genesis-framework.php
Created October 6, 2015 11:32
Display Soliloquy WordPress Slider in Home of Front Page after header - Genesis Framework
// Display Soliloquy WordPress Slider in Home of Front Page after header - Genesis Framework
add_action( 'genesis_after_header', 'recreate_soliloquy_slider' );
/**
* Display Soliloquy WordPress Slider in Home of Front Page after header - Genesis Framework
* Scope: Homepage or Front page.
* @author Sridhar Katakam
* @link http://sridharkatakam.com/
@fernandiez
fernandiez / custom-icons-simple-social-icons.php
Last active October 14, 2015 11:59
Replace, reorder and add new glyphicons in Simple Social Icons http://glyphicons.com/
<?php // remove this line
//* Replace, reorder and add new icons in Simple Social Icons
//* Added WordPress, SoundCLoud and Spotify icons
//* https://gist.github.com/srikat/11391704
//* http://glyphicons.com/
add_filter( 'simple_social_default_profiles', 'custom_simple_social_default_profiles' );
function custom_simple_social_default_profiles() {
$glyphs = array(
@fernandiez
fernandiez / karmacrazy-button-genesis-simple-share.php
Last active October 14, 2015 22:10
Adds Karmacrazy social button to Genesis Simple Share
<?php // remove this line
//* Adds Karmacrazy social button to Genesis Simple Share (f)
//* https://gist.github.com/srikat/787e8d8bad7ec06a40fe
add_action( 'genesis_entry_content', 'kcy_simple_share', 9 );
function kcy_simple_share() {
if ( ! function_exists('genesis_share_icon_output') ) {
return;
}
if ( is_single() ) {
@fernandiez
fernandiez / .htaccess
Last active April 12, 2016 06:15
Change domain URLs from old to new domain .htaccess
# Change domain URLs from old to new domain (both domains parked on top of the same hosting)
# With www or without www
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^olddomain.com$
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>
@fernandiez
fernandiez / .htaccess
Created May 31, 2016 10:18
Domain 301 redirection from without www to www domain
# Domain 301 redirection from without www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
@fernandiez
fernandiez / .htaccess
Last active June 1, 2016 09:26
Redirection 301 .htaccess from HTTP to HTTPS (with www)
#Redirect 301 from HTTP to HTTPS
#First, rewrite any request to the correct domain (with www)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#Then, rewrite to HTTPS:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@fernandiez
fernandiez / index.php
Last active September 6, 2016 17:06
WordPress WP_Query with just sticky posts - page.php or index.php template
<?php
/**
* WordPress WP_Query with just sticky posts - page.php or index.php template
**/
get_header(); // loads header.php template ?>
<?php $custom_query = new WP_Query('posts_per_page=1'); ?>
<div id="wrap-sample" class="blog-sample clearfix">