Skip to content

Instantly share code, notes, and snippets.

Avatar

Spencer Finnell spencerfinnell

View GitHub Profile
@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 function.php
<?php
// Add your own function to filter the fields
add_filter( 'submit_job_form_fields', 'remove_listify_submit_job_form_fields', 9999 );
// This is your function which takes the fields, modifies them, and returns them
function remove_listify_submit_job_form_fields( $fields ) {
if( ! isset( $fields['job'] ) ) {
return $fields;
}
View class-widget-home-cta.php
<?php
/**
* Standard: Call to Action
*
* @since Listify 1.4.0
*/
class Listify_Widget_Call_To_Action extends Listify_Widget {
/**
* Register widget and settings.
View style.css
.my-custom-class {
border-color: red;
}
@spencerfinnell
spencerfinnell / functions.php
Last active Jan 31, 2017
Add a custom CSS class to the listing description widget wrapper.
View functions.php
<?php // exlude this line if your functions.php already contains one.
/**
* Add a `my-custom-class` CSS class to the Listing: Description widget.
*/
function custom_listify_widget_panel_listing_content( $content ) {
$content = str_replace( 'widget widget-job_listing', 'widget widget-job_listing my-custom-class', $content );
return $content;
}
View functions.php
function custom_login_url() {
add_filter( 'login_url', array( jobify()->get( 'woocommerce' ), 'login_url' ), 10, 2 );
}
add_action( 'init', 'custom_login_url' );
@spencerfinnell
spencerfinnell / functions.php
Last active Oct 3, 2016 — forked from tripflex/functions.php
Automatically set/assign parent taxonomy terms for hierarchical taxonomies in WordPress
View functions.php
<?php
add_action( 'set_object_terms', 'auto_set_parent_terms', 9999, 6 );
/**
* Automatically set/assign parent taxonomy terms to posts
*
* This function will automatically set parent taxonomy terms whenever terms are set on a post,
* with the option to configure specific post types, and/or taxonomies.
*
View gist:aecedfcb3eca0fc2825eb5ac492f445e
remove_action( 'listify_output_customizer_css', array( 'Listify_Customizer_OutputCSS_Typography', 'output' ), 10 );
View functions.php
function custom_resume_manager_update_resume_data() {
$user = wp_get_current_user();
wp_update_user( array(
'ID' => $user->ID,
'role' => 'candidate'
) );
}
add_action( 'resume_manager_update_resume_data', 'custom_resume_manager_update_resume_data' );
View .htaccess
Header set Cache-Control "no-transform"
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
You can’t perform that action at this time.