Skip to content

Instantly share code, notes, and snippets.

View davidperezgar's full-sized avatar

David Perez davidperezgar

View GitHub Profile
@davidperezgar
davidperezgar / .gitignore
Created March 10, 2019 22:37
Gitignore recommended for WordPress Site repository
#Wordpress
htaccess.txt
index.php
licencia.txt
license.txt
readme.html
robots.txt
wp-activate.php
wp-blog-header.php
wp-comments-post.php
@davidperezgar
davidperezgar / .git-ftp-ignore
Created March 6, 2019 10:30
GIT FTP Ignore
.ftpquota
.gitignore
@davidperezgar
davidperezgar / git-ftp-config
Last active March 6, 2019 10:29
GIT FTP Config lines
[git-ftp]
      url = ftp://ftp.url.com:21/www/
      user = username
      password = "pass"
@davidperezgar
davidperezgar / fixed-header-wordpress.css
Created March 21, 2017 10:47 — 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.
/*
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 November 11, 2016 21:31
Remove Woocommerce admin notice
// Remove WooCommerce Updater
remove_action('admin_notices', 'woothemes_updater_notice');
@davidperezgar
davidperezgar / functions.php
Created November 11, 2016 12:20
Genesis Revolution slider in home page, featured rest
//* 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 November 7, 2016 17:17
Adds Excerpts to Pages in WordPress
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 October 31, 2016 23:28 — 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/
// 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' );
}
@davidperezgar
davidperezgar / functions.php
Created October 31, 2016 23:28 — forked from srikat/functions.php
Horizontal Opt-in Form in Genesis using eNews Extended plugin and Flexbox. https://sridharkatakam.com/horizontal-opt-form-genesis-using-enews-extended-plugin-flexbox/
// 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 20:45
Bitbucket Pipelines YML to FTP
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/