Skip to content

Instantly share code, notes, and snippets.

View freezvd's full-sized avatar

Valentin Zmaranda freezvd

  • Bucharest, Romania
View GitHub Profile
@freezvd
freezvd / jetpack-open-graph-tags.php
Last active September 7, 2015 09:28 — forked from nathanrice/jetpack-open-graph-tags.php
Use Genesis Doctitle and Meta Description with Jetpack's Open Graph tags on entry pages.
<?php
add_filter( 'jetpack_open_graph_tags', 'nr_jetpack_open_graph_tags_filter' );
/**
* Filter open graph tags to use Genesis doctitle and meta description instead.
*
* @author Nathan Rice
* @link https://gist.github.com/4683845
*/
function nr_jetpack_open_graph_tags_filter( $tags ) {
@freezvd
freezvd / functions.php
Last active September 7, 2015 09:28 — forked from nathanrice/functions.php
Enable Genesis Accessibility
//* Add Accessibility support
add_theme_support( 'genesis-accessibility', array( 'headings', 'drop-down-menu', 'search-form', 'skip-links' ) );
<?php
//* Do NOT include the opening php tag
add_filter( 'stylesheet_uri', 'custom_replace_default_style_sheet', 10, 2 );
/**
* Replace main theme style sheet with custom one if viewing post in a particular category.
*
* Note: Replace X with the category ID you want to target.
*/
function custom_replace_default_style_sheet( $stylesheet, $stylesheet_dir ) {
@freezvd
freezvd / functions.php
Last active September 7, 2015 09:26 — forked from nathanrice/functions.php
Remove entry meta for post types
<?php
add_action( 'init', 'sample_remove_entry_meta', 11 );
/**
* Remove entry meta for post types
*
* @link https://gist.github.com/nathanrice/03a5871e5e5a27f22747
*/
function sample_remove_entry_meta() {
remove_post_type_support( 'post-type', 'genesis-entry-meta-before-content' );
@freezvd
freezvd / modify-search-genesis.php
Last active August 28, 2015 08:13 — forked from schlessera/modify-search-genesis.php
Add one or more classes to the Genesis search form's 'Submit' button
<?php
/**
* Add one or more classes to the Genesis search form's 'Submit' button
* @author Alain Schlesser ([email protected])
* @link http://www.brightnucleus.com/add-class-wordpress-search-button/
*
* @param string $form the search form HTML output
* @param string $search_text text inside the search text entry box
* @param string $button_text caption of the search button
@freezvd
freezvd / functions.php
Last active August 27, 2015 12:50 — forked from srikat/functions.php
Adding a search form input button icon inside the input box in Genesis. http://sridharkatakam.com/adding-search-form-input-button-icon-inside-input-box-genesis/
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' );
}
//* Customize search form input button text
add_filter( 'genesis_search_button_text', 'sk_search_button_text' );
@freezvd
freezvd / infinite-scroll-masonry-imagesloaded.php
Last active August 29, 2015 14:27 — forked from gregrickaby/infinite-scroll-masonry-imagesloaded.php
Infinite Scroll + Masonry + ImagesLoaded
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
@freezvd
freezvd / template-gallery.php
Last active August 29, 2015 14:27 — forked from billerickson/template-gallery.php
Pagination in a custom query
@freezvd
freezvd / genesis-custom-loop-pagination.php
Last active August 29, 2015 14:27 — forked from billerickson/genesis-custom-loop-pagination.php
Genesis custom loop with pagination
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed
<?php
/**
* Create a split test using two different GravityForms
*
* Allows you to test the effectiveness of two different forms by displaying each
* one 50% of the time. Tracking CTR using the built-in GravityForms functionality
* should give you an idea of which form is most effective.
*
* @uses GravityForms
* @author FAT Media, LLC