Skip to content

Instantly share code, notes, and snippets.

View arkadiusjonczek's full-sized avatar
🏴‍☠️

Arkadius Jonczek arkadiusjonczek

🏴‍☠️
View GitHub Profile
@arkadiusjonczek
arkadiusjonczek / front-page.php
Last active August 29, 2015 14:15
Custom front page in Wordpress using Genesis Framework
<?php
// front-page.php
// set full width layout
add_filter ( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
// add section right after header without inner div box for full width
add_action( 'genesis_after_header', 'aj_home_double_opt_in' );
<?php
/*
Plugin Name: calc
Plugin URI:
Description: Calculates loans/how much can be borrowed
Version: 1.0
Author: Mikey
Author URI:
*/
@arkadiusjonczek
arkadiusjonczek / functions.php
Created February 22, 2015 00:33
WordPress: Remove content on front page
// insert into functions.php
add_action( 'genesis_before','remove_homepage_content' );
function remove_homepage_content() {
if (is_front_page() ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
}
}
@arkadiusjonczek
arkadiusjonczek / functions.php
Created February 22, 2015 00:36
WordPress: Add new image sizes
// insert into functions.php
//* Add new image sizes
add_image_size('grid-thumbnail', 100, 100, TRUE);
@arkadiusjonczek
arkadiusjonczek / front-page.php
Created February 22, 2015 09:56
WordPress: Custom Genesis front page with two feature boxes (above and under the content box)
<?php
// front-page.php
// set full width layout
add_filter ( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
// add section right after header without inner div box for full width
add_action( 'genesis_after_header', 'aj_feature_box' );
@arkadiusjonczek
arkadiusjonczek / functions.php
Created February 23, 2015 15:19
WordPress: Show thumbnail in blog posts using Genesis Framework
// insert into functions.php
// please activate featured image in Genesis settings
// show thumbnail in blog post
add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
function single_post_featured_image() {
if ( ! is_singular( 'post' ) ) return;
@arkadiusjonczek
arkadiusjonczek / front-page.php
Created February 24, 2015 17:49
WordPress: get and show latest 3 posts using WP_Query
$wp_query = new WP_Query( 'posts_per_page=3' );
$first = ' first';
if ( $wp_query->have_posts() ) :
while ( $wp_query->have_posts() ) :
$wp_query->the_post();
printf( "<article class=\"one-third{$first}\">%s</article>", get_the_title() );
if ($first != '') $first = '';
@arkadiusjonczek
arkadiusjonczek / gist:d62dac3e588c96cec8b1
Created June 5, 2015 01:27
WordPress TablePress: Search for text in table using anker link (filter rows)
<a href="" class="filter_remove">Alle</a>
<a href="" class="filter_table">Funktion X</a>
<a href="" class="filter_table">Funktion Y</a>
<a href="" class="filter_table">Nichts</a>
[table id=1 /]
<script>
jQuery(document).ready(function($) {
$('a.filter_table').click(function(e) {
@arkadiusjonczek
arkadiusjonczek / functions.php
Created June 9, 2015 00:34
Remove Genesis Credits Footer
//* Remove Credits & more
remove_action('genesis_footer', 'genesis_do_footer');
@arkadiusjonczek
arkadiusjonczek / .htaccess
Created August 3, 2015 09:33
Force to use www.domain.de (SEO)
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
# force to use www.domain.de
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>