php

UUP Dev Guide

We designed the University User Profiles plugin to be very flexible for developers.

You will need to create a new page template as part of a custom or child theme, and add the PHP below.

Basic List

Add this PHP to a custom WordPress page template to start seeing all of the different fields. To hide certain fields, change their value from ‘true‘ to ‘false‘.


$args = array(
	'tags' => array(),
	'name' => true,
	'image' => true,
	'title' => true,
	'phone1' => true,
	'phone2' => true,
	'email' => true,
	'fax' => true,
	'officeLocation' => true,
	'officeHours' => true,
	'mailingAddress' => true
	);
list_all_public($args);

Using Tags to Filter Users

If you’d like to start listing only those users with a specific tag, add those tag words into the ‘tags’ array like so. This example will only display users that have the tag “faculty”.


$args = array(
	'tags' => array('faculty'),
	'name' => true,
	'image' => true,
	'title' => true,
	'phone1' => true,
	'phone2' => true,
	'email' => true,
	'fax' => true,
	'officeLocation' => true,
	'officeHours' => true,
	'mailingAddress' => true
	);
list_all_public($args);

You can add multiple tags to create more specific groupings. This example will only display users with the tags “faculty” and “associate”.


$args = array(
	'tags' => array('faculty', 'associate'),
	'name' => true,
	'image' => true,
	'title' => true,
	'phone1' => true,
	'phone2' => true,
	'email' => true,
	'fax' => true,
	'officeLocation' => true,
	'officeHours' => true,
	'mailingAddress' => true
	);
list_all_public($args);

Child Theming with CSS

Cornerstone was built with SASS, but you can still develop with normal CSS.

Don’t use @import in your CSS file, or your site will break in IE8.

Instead, add this to your functions.php file:

<?php
function link_parent_theme_style() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri() );
}
add_action('wp_enqueue_scripts', 'link_parent_theme_style');
?>

Typically, a child theme will @import the css of the parent theme. Bootstrap 3, the framework which Cornerstone is based on, offers very limited support for Internet Explorer 8. By default, a Bootstrap 3 site in IE8 will render the mobile view. One column of content, and the collapse mobile navigation.

Being that IE8 accounts for a sizable (~7%) of traffic on Aurora, Cornerstone makes use of respond.js, which uses javascript to mimic media queries for IE8. However, respond.js will not work on anything loaded via @import. So this alternate method is required.