Skip to content

Instantly share code, notes, and snippets.

View carasmo's full-sized avatar

Christina carasmo

  • Florida
View GitHub Profile
@carasmo
carasmo / functions.php
Created February 28, 2017 21:12
add Genesis SEO and Archive Page Settings Pages for CPTS added via plugin
<?php
// don't add above
/**
*
* Add Genesis SEO and Archive Settings to faq and testimonial post types added via plugin
*
*/
@carasmo
carasmo / asynchronous-facebook-like-box.html
Created February 28, 2017 16:35
Non blocking asynchronous Facebook Like box
<!--
Remove the FB like box script from your header and modify the following for your use.
Then place it in your html (like a widget area) where you want it to appear.
-->
@carasmo
carasmo / for-functions.php
Last active February 10, 2017 21:04
Avoiding the 404 when pagination of a cpt or term of cpt does is under the posts per page settings in reading settings.
<?php
//don't add
// posts per page for CPT 'your-cpt'
function yourprefix_posts_per_page_in_portfolio_cpt( $query ) {
if ( ! is_admin() && is_post_type_archive( 'your-cpt' ) ) {
$query->set( 'posts_per_page', 2 );
@carasmo
carasmo / for-functions.php
Created February 10, 2017 19:41
Genesis Child theme remove the Colors Customizer section but not the functionality
<?php
// DO NOT ADD ABOVE
/* Instructions only: put this at the very bottom of your functions.php file.
* outside of all other functions, registrations, etc.
* so go to the very very bottom with your code editor and hit return a couple times to get some white space and then
* paste code below in and change the two instances of yourprefix_ (that's an underscore) to yourname or initials
*/
<?php
//don't add
/*
* Add Genesis one-third (3 col) class to the article.post in archives
* in the main query. Uses Genesis specific filter
* instead of WordPress's post_class filter
* to do the same thing 'cause why not!
*
*/
@carasmo
carasmo / style.css
Created January 30, 2017 23:04
Move date before title in featured posts widget
/* put date before title in featured post widget */
.featuredpost .entry-title {
display: table-footer-group;
position: relative;
top: -5px; /* adjust as needed */
}
.featuredpost .entry-meta {
@carasmo
carasmo / choose-primary-category-to-display.php
Last active July 11, 2017 18:48
Get a Primary Category to display in the post_meta Genesis
<?php
//don't add
/**
*
* Create Metabox and Primary Category Select Field
* Requires CMB2 TRUNK branch NOT the plugin from the repo
* Install CMB2-trunk.zip via plugin interface or incorporate in your theme, read their docs
* https://github.com/WebDevStudios/CMB2/branches
*
@carasmo
carasmo / exclude-categories-by-term-id-in-post_meta.php
Last active January 29, 2017 18:07
Exclude Categories from the post_meta output
<?php
//don't add
/**
*
* Exclude Terms by ID from the get_the_category_list(); (WordPress core)
* Ref: http://stackoverflow.com/a/34817401/1004312
* I add a post to two categories with the ids (examples) 200 and 266
* but I only want 200 in the post_meta shortcode in Genesis
* which uses the get_the_category_list(); (WordPress core) which has no filter
@carasmo
carasmo / check-woo-commerce-version.php
Created January 27, 2017 21:56
Check WooCommerce version using version_compare( WC_VERSION ...
<?php
//don't add this above
//change the hook and the function name
function yourprefix_woocommerce_function_does_what() {
if ( ! class_exists( 'WooCommerce' ) ) return;
@carasmo
carasmo / move-comment-form-above-comments-genesis.php
Last active January 25, 2017 17:44
Move comment form above comments / discussion in Genesis
<?php
//do not add above php tag
/**
*
* add comment form above the discussion (list of comments)
* change yourprefix_ to yours
*/
function yourprefix_reorder_comment_form_before_discussion() {