Skip to content

Instantly share code, notes, and snippets.

View chered's full-sized avatar

chered chered

View GitHub Profile
$role = get_role( 'author' );
$role->remove_cap( 'upload_files' );
@chered
chered / gist:0146a7d3fb8323e4e7de8d706aa95900
Created July 29, 2020 05:27
wordpress - first and last name author display plus date
<div class="r-author"><?php the_author_meta( 'user_firstname', $userID ); ?>&nbsp;<?php the_author_meta( 'user_lastname', $userID ); ?>&nbsp;-&nbsp;<?php the_date(); ?> </div>
(function($) {
// store the image link inside a variable from 'src' attribute
var getImageSrc = $('.banner-front-left .fl-post-grid-image img').attr('src');
// add div background image using the variable above
$('.banner-front-left .fl-post-grid-image').css('background-image', 'url(' + getImageSrc + ')');
// store the image link inside a variable from 'src' attribute
var getImageSrc = $('.banner-top-right .fl-post-grid-image img').attr('src');
function my_pmprorh_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
// Define the fields.
$fields = array();
$fields[] = new PMProRH_Field(
'first_name', // input name, will also be used as meta key
//create shortcode for a coach archive row
function myt_create_shortcode_coach_post_type(){
$args = array(
'post_type' => coach,
'posts_per_page' => 6,
'post_status' => publish
);
$query = new WP_Query($args);
//seach template for coach cpt
function template_chooser($template) {
global $wp_query; $post_type = get_query_var('post_type');
if( $wp_query->is_search && $post_type == 'coach' ) {
return locate_template('page_coach.php');
} return $template;
} add_filter('template_include', 'template_chooser');
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color:#909 !important;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color:#909 !important;
opacity:1 !important;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color:#909 !important;
opacity:1 !important;