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
@davidperezgar
davidperezgar / fixed-header-wordpress.css
Created Mar 21, 2017 — forked from robneu/fixed-header-wordpress.css
Assign the fixed position to your header and set the width to 100%. You'll also need to set a high z-index to make sure your header doesn't get overlapped by embeded objects and other similar items. The second part will make your site look normal when you're logged in and the admin bar is showing.
View fixed-header-wordpress.css
/*
Site Header
---------------------------------------------------------------------------------------------------- */
/* This is where the magic happens. You need
* to assign a fixed position in order for
* everything else to work correctly.
--------------------------------------------- */
.site-header {
position: fixed;
top: 0;
@davidperezgar
davidperezgar / functions.php
Created Nov 11, 2016
Remove Woocommerce admin notice
View functions.php
// Remove WooCommerce Updater
remove_action('admin_notices', 'woothemes_updater_notice');
@davidperezgar
davidperezgar / functions.php
Created Nov 11, 2016
Genesis Revolution slider in home page, featured rest
View functions.php
//* Adds featured image in home
add_image_size( 'destacada_pagina', 1440, 470, true );
add_action('genesis_after_header','cmk_home_img');
function cmk_home_img() {
if ( has_post_thumbnail() && !is_singular() && !is_home() && !is_front_page()) {
echo '<div class="miniatura text-center">';
the_post_thumbnail('destacada_pagina');
echo '</div>';
} elseif (is_home() || is_front_page()) {
echo '<section id="slider">';
@davidperezgar
davidperezgar / functions.php
Created Nov 7, 2016
Adds Excerpts to Pages in WordPress
View functions.php
add_action( 'init', ‘cmk_add_excerpts_to_pages' );
function cmk_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
@davidperezgar
davidperezgar / functions.php
Created Oct 31, 2016 — forked from srikat/functions.php
Add Content below Title for Posts page inside div.posts-page-description in Genesis. https://sridharkatakam.com/adding-content-title-inside-div-posts-page-description-genesis/
View functions.php
// Bring back the missing editor for Posts page
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' );
function rgc_posts_page_edit_form( $post ) {
$posts_page = get_option( 'page_for_posts' );
if ( $posts_page === $post->ID ) {
add_post_type_support( 'page', 'editor' );
}
View functions.php
// Register Horizontal Opt-in widget area
genesis_register_widget_area(
array(
'id' => 'horizontal-opt-in',
'name' => __( 'Horizontal Opt-in', 'my-theme-text-domain' ),
'description' => __( 'This is the horizontal opt-in section.', 'my-theme-text-domain' ),
)
);
// Display Horizontal Opt-in widget area below header
@davidperezgar
davidperezgar / bitbucket-pipelines.yml
Last active May 20, 2017
Bitbucket Pipelines YML to FTP
View bitbucket-pipelines.yml
image: savjee/docker-s3website-git-ftp-deploy
pipelines:
default:
- step:
script:
- git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://s1.closemarketing.net/domains/domain.com/public_html/
@davidperezgar
davidperezgar / functions.php
Created Oct 21, 2016 — forked from fernandiez/functions.php
Taxonomy title and description (category, tag, taxonomy) in Genesis Child Theme
View functions.php
//* Adding WordPress Taxonomy title and description (category, tag, taxonomy)
add_action( 'genesis_before_loop', 'cmk_output_category_info' );
function cmk_output_category_info() {
if ( is_category() || is_tag() || is_tax() ) {
echo '<div class="archive-description">';
echo '<h1 class="archive-title">';
echo single_term_title();
@davidperezgar
davidperezgar / functions.php
Created Oct 21, 2016 — forked from billerickson/functions.php
Use the built-in post counter
View functions.php
<?php
/**
* Use the built-in post counter
*
* Sometimes you'll want to keep track of which post you're on in a loop.
* Some people create their own $loop_counter (ex: Genesis, https://gist.github.com/4675237 ).
* There's a better way! A loop counter is built into $wp_query. Ex:
*
* global $wp_query;
* echo $wp_query->current_post
@davidperezgar
davidperezgar / functions.php
Created Oct 20, 2016 — forked from jameskoster/functions.php
WooCommerce - change number of products displayed per page
View functions.php
// Display 24 products per page. Goes in functions.php
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );
You can’t perform that action at this time.