Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernan fernandiez

View GitHub Profile
@fernandiez
fernandiez / functions.php
Created Feb 27, 2015
Taxonomy title and description (category, tag, taxonomy) in Genesis Child Theme
View functions.php
//* Adding WordPress Taxonomy title and description (category, tag, taxonomy)
/**
* Add Category Heading to Each Page in Pagination in Genesis
* @link https://gist.github.com/neilgee/6c0414cfef06e41a6606
* Prints a category's title and description in Genesis
* @link https://gist.github.com/EngageWP/df43e156e76fa5cdd6c0
*/
add_action( 'genesis_before_loop', 'rv_output_category_info' );
@fernandiez
fernandiez / wpbilbao-plugins
Created Mar 13, 2015
WordPress Bilbao #wpbilbao @ Plugins Básicos + Debate abierto - Créditos
View wpbilbao-plugins
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 Jul 13, 2015
Activate manual excerpts on WordPress pages
View page-manual-excerpts.php
<?php // remove this line
//* Activate Manual excerpt on Pages
add_post_type_support('page', 'excerpt');
@fernandiez
fernandiez / update-domain.php
Created Jul 15, 2015
SQL update to change domain name in WordPress database
View update-domain.php
// 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 Oct 6, 2015
Display Soliloquy WordPress Slider in Home of Front Page after header - Genesis Framework
View soliloquy-slider-wordpress-genesis-framework.php
// 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 Oct 14, 2015
Replace, reorder and add new glyphicons in Simple Social Icons http://glyphicons.com/
View custom-icons-simple-social-icons.php
<?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 Oct 14, 2015
Adds Karmacrazy social button to Genesis Simple Share
View karmacrazy-button-genesis-simple-share.php
<?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 Apr 12, 2016
Change domain URLs from old to new domain .htaccess
View .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
Last active Jun 1, 2016
Redirection 301 .htaccess from HTTP to HTTPS (with www)
View .htaccess
#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 / .htaccess
Created May 31, 2016
Domain 301 redirection from without www to www domain
View .htaccess
# 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]