Skip to content

Instantly share code, notes, and snippets.

View carasmo's full-sized avatar

Christina carasmo

  • Florida
View GitHub Profile
@carasmo
carasmo / numbered-comment-pagination-genesis.php
Last active September 3, 2017 12:39
Numbered Comment Pagination in Genesis
<?php
//don't add again
add_action( 'genesis_comments', 'your_prefix_paginate_comments', 15 );
/**
* Paginate Comment Navigation
*/
function your_prefix_paginate_comments() {
@carasmo
carasmo / intro_text_or_whatever_on_blog_posts_page_blog_template_page.php
Created September 2, 2017 18:00
Add intro text on blog posts page or a page using the blog template in Genesis
<?php
//don't add again
add_action( 'edit_form_after_title', 'your_prefix_posts_page_edit_form' );
/**
* Add Editor Back on Posts Page
* @thanks https://robincornett.com/posts-page/
*/
function your_prefix_posts_page_edit_form( $post ) {
@carasmo
carasmo / wp-admin-widgets_close_first_by default.php
Created September 2, 2017 15:12
Close First Sidebar (widget area) by default.
<?php
// don't add again
/**
* Close First Widget Area by default
* @modified from: https://wordpress.stackexchange.com/a/114724/64742
*/
add_action( 'admin_footer-widgets.php' , function(){
?>
@carasmo
carasmo / rounding.css
Last active July 29, 2017 21:28
Hide rounding error FlexSlider WooCommerce
.onsale {
box-sizing: content-box;
}
.woocommerce-product-gallery.woocommerce-product-gallery--with-images .flex-control-nav.flex-control-thumbs li {
padding: 2px;
}
.single-product .woocommerce-product-gallery.woocommerce-product-gallery--with-images > ol.flex-control-nav.flex-control-thumbs {
margin: 2px -2px 0;
@carasmo
carasmo / classic-text-widget-class.php
Last active October 31, 2017 22:17
Use the plugin: https://github.com/vfontjr/classic-text-widget/ -- the filters were renamed with the prefix ``classic_`` before so to allow shortcodes and other things on the widget, you will need to do the following: ``add_filter( 'classic_widget_text', 'do_shortcode' );``
<?php namespace Your_Name_Space;
/**
*
* Classic Text Widget to address 4.8 WordPress Update
*
* READ AND DO:
* Change the text domain ``your-text-domain`` = 2 locations in the code
* Change the namespace ``Your_Name_Space`` 3 locations in the code
@carasmo
carasmo / gen-port-pro-ppp-orderby-asc-menu-order.php
Last active June 8, 2017 18:56
Genesis Portfolio Pro CPT Plugin posts per page and orderby query
<?php
//don't add again
//** posts per page and menu order asc for cpt portfolio query
function yourprefix_order_by_menu_order_asc_genesis_portfolio_pro( $query ) {
if ( ! function_exists( 'genesis_portfolio_init' ) ) { return $query; }
if ( $query->is_post_type_archive('portfolio') && $query->is_main_query() ) :
@carasmo
carasmo / cmb2_text_field_example.php
Last active June 8, 2017 18:56
Add field with CMB2 to a CPT and show it in Genesis Entry Content
<?php
// don't add twice
// 1. this adds the metabox and field to the CPT tesimonial (see CMB2 docs). Requires CMB2.
/**
*
* Add Testimonial Author Metabox and Field
*
*/
<?php
//don't re-add
/**
*
* custom entry content : replace the archive content with your own build for the excerpt/content limit
*
@carasmo
carasmo / allowed-html-force-balance-tags.php
Last active March 24, 2017 21:44
Allowed Html in Content Limit and Balance tags so that there are not open tags messing up your site.
<?php
//don't add again
/**
*
* Allowed html in get_the_content_limit
*
*/
function yourprefix_allowed_content_limit_tags() {
@carasmo
carasmo / put-primary-sidebar-in-secondary-location-css.css
Last active March 6, 2017 11:18
Genesis Swap Put Primary Sidebar into Secondary Sidebar location (it's better to use CSS for this)
/* CSS is best and forget the php : see image in the comments. This is only partial css for that layout. */
@media (min-width: 1200px) {
/* ## sidebar-content-sidebar
--------------------------------------------- */
.sidebar-content-sidebar .content-sidebar-wrap {
width: 80%;