Skip to content

Instantly share code, notes, and snippets.

View mavieth's full-sized avatar

Michael Vieth mavieth

View GitHub Profile
function get_general_users(){
// WP_User_Query arguments
$args = array (
'orderby' => 'id',
'meta_key' => 'trainer_id',
'meta_value' => '',
'meta_compare' => '!=',
'order' => 'DESC'
);
$blogusers = get_general_users();
$arr = array();
foreach ( $blogusers as $user ) {
$meta = get_user_meta($user->ID);
$link = get_edit_user_link( $user->ID);
$editUserLink = '<a href=' .$link. '>Edit User Profile</a>';
$profileArray =array(
"Display Name" => $user->display_name,
"Email Address" => $user->user_email,
function rss_blog(){ ?>
<h2><?php _e( 'PTRC via Yahoo Finanace:', 'my-text-domain' ); ?></h2>
<?php // Get RSS Feed(s)
include_once( ABSPATH . WPINC . '/feed.php' );
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( 'http://feeds.finance.yahoo.com/rss/2.0/headline?s=PTRC&region=US&lang=en-US' );
if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly
@mavieth
mavieth / Wordpress-Archive-By-Year.php
Created January 13, 2016 20:12
Wordpress-Archive-By-Year
Page Template
<?php
/**
* Template Name: Press By Year
*/
get_header(); ?>
<div id="content-full" class="grid col-940">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
(function($) {
function getStock(opts, type, complete) {
var defs = {
desc: false,
baseURL: 'http://query.yahooapis.com/v1/public/yql?q=',
query: {
quotes: 'select * from yahoo.finance.quotes where symbol = "{stock}" | sort(field="{sortBy}", descending="{desc}")',
historicaldata: 'select * from yahoo.finance.historicaldata where symbol = "{stock}" and startDate = "{startDate}" and endDate = "{endDate}"'
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
/* This function is called when the module is loaded. */
int simple init(void){
printk(KERN INFO "Loading Module\n"); return 0;
}
/* This function is called when the module is removed. */
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top material-static-top" role="banner">
<div class="container">
<div class="navbar-header material-header">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,900,700,300' rel='stylesheet' type='text/css'>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@mavieth
mavieth / Hexo-Generator.sh
Last active February 27, 2016 01:34
Installs Hexo Based Website.
#!/bin/bash
DARKGRAY='\033[1;30m'
RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHTPURPLE='\033[1;35m'
<?php
add_action('pre_get_posts', 'filter_categories_homepage');
function filter_categories_homepage($query) {
if ($query->is_main_query() && is_home()) {
$query->set('category_name','tutorials');
}
}
?>