Skip to content

Instantly share code, notes, and snippets.

View crossreftech's full-sized avatar

CrossRefTech crossreftech

View GitHub Profile
/* Use the fa-spin class to get any icon to rotate. */
<i class="fa fa-spinner fa-spin"></i>
<i class="fa fa-circle-o-notch fa-spin"></i>
<i class="fa fa-refresh fa-spin"></i>
<i class="fa fa-cog fa-spin"></i>
/* To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes. */
<i class="fa fa-thumbs-up fa-lg"></i>
<i class="fa fa-thumbs-up fa-2x"></i>
<i class="fa fa-thumbs-up fa-3x"></i>
<i class="fa fa-thumbs-up fa-4x"></i>
<i class="fa fa-thumbs-up fa-5x"></i>
<i class="fa fa-thumbs-up"></i>
<?php
// I hope this can help out someone else so they don't go though the same frustration that I did. I was trying to use the taxonomy_select
// metabox to display two dropdowns/select boxes but couldn't get them both to save. Saving or updating would force both to save as the
// second value. Below is the code that I used to allow me to save the data separately into usable post meta. If you are using this with
// multiple selects there is still no need to create more then one function, this will work on all of them.
// I first created a function outside the metabox to loop though my custom taxonomy.
function get_team_names( $taxonomy = 'team_category', $args = array() ) {
@crossreftech
crossreftech / Use Font Awesome With WordPress.php
Last active August 29, 2015 14:07
Use Font Awesome With WordPress
<?php // Be sure not to add the opening php tag
function enqueue_font_awesome() {
wp_enqueue_style( 'icon-fonts', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', array(), CHILD_THEME_VERSION );
}
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
Posted <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago';
<?php
// Add Custom Post Type Taxonomies To At A Glance Dashboard Widget
function add_post_type_tax_to_right_now() {
$args = array(
'public' => true ,
'_builtin' => false
);
$output = 'object';
$operator = 'and';
$taxonomies = get_taxonomies( $args , $output , $operator );
<?php
// Add Custom Post Type to At A Glance Dashboard Widget
function add_post_type_to_right_now() {
$args = array(
'public' => true ,
'_builtin' => false
);
$output = 'object';
$operator = 'and';
$post_types = get_post_types( $args , $output , $operator );
<?php
// Hide your WordPress version
remove_action('wp_head', 'wp_generator');
?>