This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize the post meta "FILED UNDER: -category name-" categories text and below the post preview in a blog page and change it at the bottom of a post. | |
// http://wordpress.stackexchange.com/questions/50961/removing-post-meta-from-category-pages */ | |
// | |
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); | |
function sp_post_meta_filter($post_meta) { | |
if ( !is_page() ) { | |
if (is_archive() ) $post_meta = ''; | |
else $post_meta = '[post_categories before="Categories: "] [post_tags before="Keywords: "]'; | |
return $post_meta; | |
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************** https://github.com/cosmic/cosmic-tinymce-excerpt | |
* Plugin Name: Cosmic TinyMCE Excerpt | |
* Description: TinyMCE pour les extraits | |
* Author: Agence Cosmic | |
* Author URI: http://agencecosmic.com/ | |
* Version: 1.0 | |
****************************/ | |
function cosmic_activate_page_excerpt() { | |
add_post_type_support('page', array('excerpt')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Altitude Pro customize.php code - | |
// Tutorial I am brushing up is here: http://easywebdesigntutorials.com/customizing-altitude-pro-genesis-child-theme/ | |
<?php | |
/** | |
* Customizer additions. | |
* | |
* @package Altitude Pro | |
* @author StudioPress | |
* @link http://my.studiopress.com/themes/altitude/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Custom Post type code used inside the functions.php file inside the Minumum Pro Genesis child theme. | |
//* Create portfolio custom post type | |
add_action( 'init', 'minimum_portfolio_post_type' ); | |
function minimum_portfolio_post_type() { | |
register_post_type( 'portfolio', | |
array( | |
'labels' => array( | |
'name' => __( 'Portfolio', 'minimum' ), | |
'singular_name' => __( 'Portfolio', 'minimum' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Made by Isaac: https://gist.github.com/itzikbenh/16326bc3947f272cd6bb44de03c4774b?fref=gc&dti=168889943173228 | |
// and improved by Ian. https://www.facebook.com/groups/advancedwp/permalink/1607185879343620/ | |
function add_category_meta_fields( $taxonomy ) { | |
?> | |
<div class="form-field create-cat term-featured-image-wrap"> | |
<label for="tax-featured-image">Featured Image</label> | |
<input id="tax-featured-image" type="text" name="featured_image"> | |
<br> | |
<button id="add-cat-featured-img" class="button" name="button">Add Featured Image</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------- WooCommerce - checkout fields ---------- */ | |
/* From Kathy. */ | |
function kia_modify_default_address_fields( $fields ){ | |
if( isset( $fields['company'] ) ) unset( $fields['company'] ); | |
if( isset( $fields['country'] ) ) unset( $fields['country'] ); | |
if( isset( $fields['address_1'] ) ) unset( $fields['address_1'] ); | |
if( isset( $fields['address_2'] ) ) unset( $fields['address_2'] ); | |
if( isset( $fields['city'] ) ) unset( $fields['city'] ); | |
if( isset( $fields['state'] ) ) unset( $fields['state'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cptui_register_my_cpts() { | |
/** | |
* Post Type: Nettmagasin. | |
*/ | |
$labels = array( | |
"name" => __( "Nettmagasin", "tm-beans" ), | |
"singular_name" => __( "Nettmagasin", "tm-beans" ), | |
"all_items" => __( "Alle Nettmag tekster", "tm-beans" ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inside your functions file add the following code | |
// | |
function wpforce_featured() { | |
global $post; | |
$already_has_thumb = has_post_thumbnail($post->ID); // If post have a featured image use that. | |
if (!$already_has_thumb) { | |
// If post does not have a featured image then get the first post image and set as featured image. | |
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); // Number 1 relates to taking post image number 1 and adding it as a featured image. | |
if ($attached_image) { | |
foreach ($attached_image as $attachment_id => $attachment) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// At http://wordpress.stackexchange.com/questions/15376/how-to-set-default-screen-options bottom comment the following code $hidden is mentioned. | |
// Hides meta boxes. Turn them on through the Screen Options. | |
add_filter( 'hidden_meta_boxes', 'custom_hidden_meta_boxes' ); | |
function custom_hidden_meta_boxes( $hidden ) { | |
// Hide meta boxes on the single Post screen | |
// Left column | |
$hidden[] = 'postexcerpt'; // Post Excerpts | |
$hidden[] = 'trackbacksdiv'; // Send Trackbacks | |
$hidden[] = 'postcustom'; // Custom Fields | |
$hidden[] = 'commentstatusdiv'; // Discussion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Custom Post type code used inside the functions.php file inside the Executive Pro Genesis child theme. | |
//* Create Portfolio Type custom taxonomy | |
add_action( 'init', 'executive_type_taxonomy' ); | |
function executive_type_taxonomy() { | |
register_taxonomy( 'portfolio-type', 'portfolio', | |
array( | |
'labels' => array( | |
'name' => _x( 'Types', 'taxonomy general name', 'executive' ), | |
'add_new_item' => __( 'Add New Portfolio Type', 'executive' ), |