Skip to content

Instantly share code, notes, and snippets.

Avatar

Spencer Finnell spencerfinnell

View GitHub Profile
@spencerfinnell
spencerfinnell / functions.php
Last active Jun 27, 2018
Limit the "Add Photo" link to only the listing owner.
View functions.php
<?php
/**
* Plugin Name: Listify - Limit Photo Uploads to Listing Owner
*/
function limit_who_can_upload($can) {
global $post;
if ( is_user_logged_in() && $post->post_author == get_current_user_id() ) {
return $can;
}
View entypo.min.css
@font-face{font-family:fontello;src:url(../fonts/entypo-combined/entypo.eot?94568459);src:url(../fonts/entypo-combined/entypo.eot?94568459#iefix) format('embedded-opentype'),url(../fonts/entypo-combined/entypo.woff?94568459) format('woff'),url(../fonts/entypo-combined/entypo.ttf?94568459) format('truetype'),url(../fonts/entypo-combined/entypo.svg?94568459#fontello) format('svg');font-weight:400;font-style:normal}.application-deadline.expired:before,.application-deadline.expiring:before,.application-deadline:before,.candidate-dashboard-action-edit:before,.entry-content #job-manager-book-marks ul.job-manager-bookmark-actions li:after,.filter_wide.filter_by_tag a.active:before,.footer-social a:before,.has-select .select:before,.job-dashboard-action-edit:before,.job-dashboard-action-mark_filled:before,.job-dashboard-action-mark_not_filled:before,.load_more_jobs:before,.nav-menu-primary li.has-children>a:after,.resume-file:before,.resume-link a:before,.showing_jobs .alert:before,.showing_jobs .reset:before,.showin
@spencerfinnell
spencerfinnell / functions.php
Last active Mar 26, 2018
Modify the homepage hero's default search arguments to add custom FacetWP filters in Listify.
View functions.php
<?php
/**
* Plugin Name: Listify - Custom FacetWP Facets on the Homepage Hero
*/
function custom_listify_widget_search_listings_default( $args ) {
$args[ 'facets' ] = 'facet1,facet2';
return $args;
}
@spencerfinnell
spencerfinnell / functions.php
Last active Jan 10, 2018 — forked from rali14/functions.php
Order Listings Randomly
View functions.php
<?php
/**
* Order items alphabetically.
*
* Remove the <?php tag if it already exists in your functions.php file.
*/
add_action( 'init', function() {
add_filter( 'get_job_listings_query_args', function( $query_args, $args = array() ) {
$query_args['orderby'] = array( 'title' => 'ASC', 'menu_order' => 'ASC' );
return $query_args;
View functions.php
<?php
/**
* Marketify functions and definitions
*
* @package Marketify
*/
/**
* Set the content width based on the theme's design and stylesheet.
*/
View functions.php
<?php
/**
* The template for displaying the call to action
*/
if ( ! listify_theme_mod( 'call-to-action-display' ) || is_user_logged_in() ) {
return;
}
$title = listify_theme_mod( 'call-to-action-title' );
@spencerfinnell
spencerfinnell / functions.php
Last active Nov 9, 2017
Use the WooCommerce "My Account" page for all login URLs.
View functions.php
<?php
/**
* Listify - WooCommerce Login URL
*/
function custom_login_url() {
global $listify_woocommerce;
add_filter( 'login_url', $listify_woocommerce->login_url(), 10, 2 );
}
@spencerfinnell
spencerfinnell / functions.php
Created Oct 16, 2017 — forked from rali14/functions.php
force autolocation on homepage only
View functions.php
function listify_custom_autolocation() {
if ( ! ( is_front_page() ) ) {
return;
}
if ( isset( $_GET['search_location'] ) ) {
return;
}
?>
<script>
View functions.php
<?php
/**
* Remove the Marketify Parent theme's CSS
*/
function marketify_docs_remove_parent_css() {
wp_dequeue_style( 'marketify-base' );
}
add_action( 'wp_enqueue_scripts', 'marketify_docs_remove_parent_css', 300 );
@spencerfinnell
spencerfinnell / functions.php
Created Jan 12, 2015
Add a button to the main single hero actions in Listify. Add 'button-secondary' class to change the color to the accent color.
View functions.php
<?php
/**
* Plugin Name: Listify - Custom Single Listing Hero Button
*/
function custom_listify_single_job_listing_actions_after() {
global $post;
$url = get_post_meta( $post->ID, 'your_custom_meta_key', true );
You can’t perform that action at this time.