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
<?php | |
add_filter( 'enter_title_here', function( $title ) { | |
$screen = get_current_screen(); | |
if ( 'your_custom_post_type' == $screen->post_type ){ | |
$title = 'Your custom placeholder text'; | |
} | |
return $title; |
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
<?php | |
// Add 'title_placeholder' to the array of arguments when registering the custom post type. | |
$cpt_args = array( | |
'title_placeholder' => 'Team member name', | |
); | |
register_post_type( 'team_members', $cpt_args ); |
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
<?php | |
// Replace with the name of your field group JSON. | |
$field_group_json = 'group_59e226a200966.json'; | |
$field_group_array = json_decode( file_get_contents( get_stylesheet_directory() . "/acf-json/{$field_group_json}" ), true ); | |
// Omit this line when using the Field Group Values package/plugin. | |
$config = $field_group_array['fields']; |
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
<?php | |
add_filter( 'get_search_form', 'prefix_render_faceted_search_form' ); | |
/** | |
* Adds checkboxes to the search form for searching specific post types. | |
* | |
* @param string $form The search form HTML output. | |
* | |
* @return string | |
*/ | |
function prefix_render_faceted_search_form( $form ) { |
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
$(document).ready(function() { | |
$(':not(.sibling-element) + .sibling-element, * > .sibling-element:first-of-type'). | |
each(function() { | |
$(this). | |
nextUntil(':not(.sibling-element)'). | |
addBack(). | |
wrapAll('<div class="sibling-wrapper" />'); | |
}); | |
}); |
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
<?php | |
$data_types = [ 'data_item_one', 'data_item_two' ]; | |
// Props to @hellofromtonya for this. | |
$data_type_placeholders = implode( ', ', array_fill( 0, count( $data_types ), '%s' ) ); | |
global $wpdb; | |
$query = " | |
SELECT pm.post_id, pm.meta_key, pm.meta_value |
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
<?php | |
add_filter( 'get_the_content_more_link', 'prefix_change_more_link_text' ); | |
/** | |
* Replaces the default Genesis [Read More...] with Read More. | |
* | |
* @param string $more_link The content more link. | |
* | |
* @return string | |
*/ | |
function prefix_change_more_link_text( $more_link ) { |
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
<form id="contact-form" method="post" action="mailer.php" role="form"> | |
<div class="messages"></div> | |
<div class="controls"> | |
<div class="row"> | |
<div class="col-md-6"> | |
<div class="form-group"> | |
<label for="form_name">Firstname *</label> |
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
<?php | |
add_action( 'cmb2_admin_init', 'yourprefix_register_demo_metabox' ); | |
/** | |
* Creating a metabox for a Genesis CPT Archive Settings page, where the CPT is 'webinars'. | |
*/ | |
function yourprefix_register_demo_metabox() { | |
/** | |
* Sample metabox to demonstrate each field type included |
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
<?php | |
add_action( 'genesis_meta', 'process_structural_wrap_handler' ); | |
/** | |
* Process the structural wrap handler. | |
* | |
* @since 1.0.0 | |
* | |
* @return void | |
*/ | |
function process_structural_wrap_handler() { |
NewerOlder