Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
@wpspeak
wpspeak / functions.php
Created September 27, 2015 02:09
Remove Genesis Framework Breadcrumb
<?php
//* Remove metaboxes in Genesis settings page
function afn_remove_metaboxes( $_genesis_theme_settings_pagehook ) {
remove_meta_box( 'genesis-theme-settings-breadcrumb', $_genesis_theme_settings_pagehook, 'main' );
}
add_action( 'genesis_theme_settings_metaboxes', 'afn_remove_metaboxes' );
@wpspeak
wpspeak / functions.php
Created September 26, 2015 12:27
Remove Jetpack Related Posts on Custom Post Types
<?php
//* Remove Jetpack Related Posts on THEMES CPT
function afn_jetpack_archive_no_related_posts( $options ) {
if ( is_post_type_archive( 'themes' ) ) {
$options['enabled'] = false;
}
return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'afn_jetpack_archive_no_related_posts' );
@wpspeak
wpspeak / functions.php
Created December 18, 2014 04:11
Conditionally add custom body class in WordPress
<?php
add_action( 'body_class', 'wpspeak_conditional_body_class');
function wpspeak_conditional_body_class( $classes ) {
if ( is_page( array( 'page-1', 'page-2', 'page-3' ) ) ) {
$classes[] = 'my-custom-page';
}
return $classes;
}
@wpspeak
wpspeak / functions.php
Created October 27, 2014 01:23
Conditionally add admin notes
<?php
//* Conditionally add admin notes
function wpspeak_admin_notice(){
global $pagenow;
if ( $pagenow == 'plugins.php' ) {
echo '<div class="updated">
<p>This notice only appears on the plugins page.</p>
@wpspeak
wpspeak / button-center.html
Last active April 16, 2019 14:18
How to Force Button to Be a The Center
<div class="button-center">
<a class="button" rel="bookmark" href="http://ituition.my/hello-world/">View Full Listing</a>
<a class="button button-right" rel="bookmark" href="http://ituition.my/hello-world/">Request Tutor</a>
</div>
@wpspeak
wpspeak / functions1.php
Created October 15, 2014 15:25
Edit or Remove "Protected" and "Password Protected" from Post Titles
<?php
//* Remove "Private: " from Private Post Titles
function wpspeak_format_post_title($content) {
return '%s';
}
add_filter('private_title_format', 'wpspeak_format_post_title');
@wpspeak
wpspeak / functions.php
Created October 13, 2014 01:48
Set default attachment display settings, alignment, link to, size in wordpress
<?php
/*
* Set default attachment display settings, alignment, link to, size in wordpress
* @Url http://wpsnipp.com/index.php/functions-php/set-default-attachment-display-settings-alignment-link-size-wordpress/
*/
function wps_attachment_display_settings() {
update_option( 'image_default_align', 'left' );
update_option( 'image_default_link_type', 'none' );
@wpspeak
wpspeak / functions.php
Created October 9, 2014 19:14
Force auto-updates for WordPress plugins
<?php
//* Force auto-updates for WordPress plugins
add_filter( 'auto_update_plugin', '__return_true' );
@wpspeak
wpspeak / functions.php
Last active April 16, 2019 14:18
Rename fields on Front-end (WP Job Manager Plugin)
<?php
//* Rename fields on Job Submission form (WP Job Manager Plugin)
add_filter( 'submit_job_form_fields', 'wpspeak_submit_job_form_fields' );
// You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/v1.2.0/includes/forms/class-wp-job-manager-form-submit-job.php#L101
function wpspeak_submit_job_form_fields( $fields ) {
// Here we target one of the job fields (job_title) and change it's label
$fields['job']['job_type']['label'] = "Level";
/* Align Simple Social Icons Centered */
.simple-social-icons ul.alignright,
.simple-social-icon ul.alignleft {
text-align: center;
}
.simple-social-icons ul.alignright li,
.simple-social-icons ul.alignleft li {
display: inline-block;
float: none;