Skip to content

Instantly share code, notes, and snippets.

View carasmo's full-sized avatar

Christina carasmo

  • Florida
View GitHub Profile
@carasmo
carasmo / hide-something-at-breakpoint.css
Last active February 16, 2016 21:10
Hide something at a break point using max-width
@media (max-width:600px) {
.hide-sm {
display:none;
}
}
@carasmo
carasmo / smooth-scroll-to-anchor.js
Created February 22, 2016 18:58
Smooth scroll to anchor on load and click. Credit: http://stackoverflow.com/a/20320919/1004312
(function(document, $, undefined) {
'use strict';
$(document).ready(function() {
//* -------- smooth scroll to anchor links on click and load ----------------------------------------------------
@carasmo
carasmo / author.php
Last active February 23, 2016 14:19
author.php page in Genesis showing only the title with the title filtered to change the h2 into h3 -- see the other gist https://gist.github.com/carasmo/70a4fd9cc27d5822e03a to get pagination.
<?php
/**
* Template Name: Author Page
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
function child_do_custom_loop( ) {
@carasmo
carasmo / for-functions.php
Last active February 23, 2016 13:14
Paginate author page: goes in your child theme functions.php file (you can use other conditions, such as `if (!is_admin() && is_archive( 'name-of-cpt' ) )` for pagination on Custom Post Types.
<?php
//don't include this
function author_posts_per_page( $query ) {
if (!is_admin() && is_author() )
$query->set( 'posts_per_page', 5 );
}
@carasmo
carasmo / for-functions.php
Last active February 23, 2016 17:50
wp_dequeue_style for Tweet This plugin
<?php
// don't use this
// this goes in your functions.php file in your child theme.
/** ====================================================================================
* wp_dequeue_style for plugins
@carasmo
carasmo / tweet-this.css
Created February 23, 2016 17:38
Tweet This replacement CSS
/* TweetThis CSS | Plugin Name: Tweet This | Author: John Morris */
.TT_wrapper {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 10px 0;
padding: 10px 10px 0 10px;
text-align: center;
}
@carasmo
carasmo / for-functions.php
Last active June 6, 2023 18:22
Force the read more link on excerpts even if the content is below the threshold and even if it's a custom excerpt.
<?php
//don't include this
/** ====================================================================================
* Force read more link to all excerpts whether or not it meets the word length criteria
* and whether or not it is a custom excerpt
==================================================================================== **/
function excerpt_more_link_all_the_time() {
@carasmo
carasmo / for-functions.php
Last active February 28, 2016 15:43
Create a custom get_posts() for use in the genesis_sitemap_output() so you can show only specific categories or show all posts but not ones in the exclude parameter. See https://codex.wordpress.org/Template_Tags/get_posts
<?php
// don't include
/** ====================================================================================
* get posts for sitemap
* https://codex.wordpress.org/Template_Tags/get_posts
==================================================================================== **/
function christina_get_posts_for_sitemap() {
@carasmo
carasmo / for-functions.php
Last active July 2, 2016 19:43
Custom genesis_sitemap_output using the previously created custom get_posts() function to exclude posts or show only a specific category.
<?php
// don't include
/** ====================================================================================
* SITE MAP : archive page filter for genesis_sitemap_output();
* using christina_get_posts_for_sitemap();
==================================================================================== **/
function christina_sitemap($sitemap_post_list) {
@carasmo
carasmo / randomtext.php
Created February 28, 2016 00:22
Replace this file in the plugin called "Random Text" Title: Random Text Slug: randomtext Author: Greg Jackson Contributors: pantsonhead. Corrects the The called constructor method for WP_Widget is deprecated since version 4.3.0! Use __construct()
<?php
/*
Plugin name: Random Text
Plugin URI: http://www.pantsonhead.com/wordpress/randomtext/