This file contains hidden or 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
<div class="grid"> | |
<!-- | |
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?> | |
--><div class="grid__item"> | |
<!-- do stuff --> |
This file contains hidden or 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 | |
$loop = new WP_Query( array( | |
'post_type' => 'Property', | |
'posts_per_page' => -1 | |
) | |
); | |
?> | |
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?> |
This file contains hidden or 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 | |
/* Template Name: Template Name */ | |
?> |
This file contains hidden or 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 | |
// Remove unnecessary menu items from admin menu | |
function remove_menus () { | |
if( is_admin() ) { | |
global $menu; | |
$restricted = array( | |
// __('Posts'), | |
// __('Comments') | |
); |
This file contains hidden or 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
$zip = '00001'; // $zip can be populated by form submission | |
$pricing = $array( | |
// zip => price associated with that zip | |
'00001' => 10, | |
'00002' => 15, | |
'00003' => 20 | |
); | |
// check if zip exists within array, and return the matching price |
This file contains hidden or 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 | |
// Code used by plugin to enqueue styles | |
wp_enqueue_style('wpProQuiz_front_style', plugins_url('css/wpProQuiz_front'.(WPPROQUIZ_DEV ? '' : '.min').'.css', WPPROQUIZ_FILE), array(), WPPROQUIZ_VERSION ); | |
wp_enqueue_style( 'sfwd_front_css', plugins_url( 'assets/css/front.css', dirname( __FILE__ ) ) ); | |
wp_enqueue_style( 'sfwd_template_css', get_stylesheet_directory_uri().'/learndash/learndash_template_style.css' ); | |
// My attempt at dequeuing styles | |
add_action( 'wp_print_styles', 'vms_dequeue_styles', 100 ); |
This file contains hidden or 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 | |
// Return users with a single language (English) | |
$args = array( | |
'meta_key' => 'wpcf-language-skill', | |
'meta_value' => 'English' | |
'meta_compare' => 'LIKE' | |
); |
This file contains hidden or 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 | |
/** | |
* Redirect users after login | |
*/ | |
add_filter('login_redirect', 'vms_login_redirect', 10, 3); | |
function vms_login_redirect( $redirect_to, $request, $user ) { | |
if( !isset( $_REQUEST['redirect_to'] ) ) { | |
if ( current_user_can( 'manage_options' ) ) { // does not return true even for admins | |
return admin_url(); |
This file contains hidden or 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
/* | |
- I have a CPT named Galleries and within this CPT there are 6 individual galleries, all using the same format. | |
- I have used the Enhanced Media Library plugin to allow a category(ies) to be added each image uploaded. | |
- single-galleries.php - is a template used for displaying each of these individual galleries. | |
- Each individual gallery has aprox 4 categories in use that are assigned to the different images. | |
- There are aprox 24 categories for all of the images across the 6 individual galleries(1-2 per image) | |
Problem: code for "gallery-filter" below is currently echoing out ALL(~24) media categores. | |
Solution needed: for only those categories acutally used on the page (rememeber 6 diff galleries) |
This file contains hidden or 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 | |
/* | |
* Dependent Plugin Activation/Deactivation | |
* | |
* Sources: | |
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/ | |
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/ | |
* | |
*/ |
OlderNewer