Skip to content

Instantly share code, notes, and snippets.

View richardegil's full-sized avatar

Richard Gil richardegil

View GitHub Profile
@richardegil
richardegil / gist:3136416
Created July 18, 2012 14:10
Accordion for Tamara
<div id="accordion">
<a class="toggler">
Learn More
</a><!--end .toggler-->
<div class="element">
<p>This is some text.</p>
</div><!--end .element-->
</div><!--end #accordion-->
// Update to css
@richardegil
richardegil / gist:3739976
Created September 17, 2012 21:43
Alternative Method
*** How to use
<?php echo open_ext("https://med.uth.edu/utms-universal/utms-superinclude-topnav.php"); ?>
*** What you include in your functions.php file
function open_ext($url){
$url = $url;
$content = wp_remote_fopen($url);
if ($content<>'') {
return $content;
} else {
if ($attachments) {
$i = 1;
foreach ($attachments as $attachment) {
echo '<a href="#myCarousel" data-to="' . $i . '" class="carousel-nav-item">' . $i .'</a>';
$i++;
}
}
@richardegil
richardegil / gist:3908101
Created October 17, 2012 20:52
attachments
Array
(
[0] => stdClass Object
(
[ID] => 14
[post_author] => 21
[post_date] => 2012-10-17 16:29:48
[post_date_gmt] => 2012-10-17 16:29:48
[post_content] => This is the description for the second slide.
[post_title] => Slide 2
@richardegil
richardegil / gist:3912552
Created October 18, 2012 15:25
For Hische
$args = array (
'post_type' => 'studentawards',
'tax_query' => array(
array(
'taxonomy' => 'year',
'field' => 'slug',
'terms' => '1994'
)
)
);
@richardegil
richardegil / gist:4020564
Created November 5, 2012 21:49
For Carlos
<p><strong>Specialties: </strong>
<?php
global $cpt_onomy;
$terms = get_the_terms( $post->ID, 'specialties' );
echo "<pre>";
print_r($terms);
@richardegil
richardegil / gist:4033104
Created November 7, 2012 17:32
for subi
<ul>
<?php $temp_query = $wp_query; query_posts("showposts=10&cat=-1000"); ?>
<?php while (have_posts()) { the_post(); ?>
<li><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to &ldquo;<?php the_title(); ?>&rdquo;"><?php the_title(); ?></a></li>
<?php } $wp_query = $temp_query; ?>
</ul>
@richardegil
richardegil / gist:4042340
Created November 8, 2012 22:44
for tamara
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox();
$(".fancybox1")
.attr('rel', 'gallery')
.fancybox();
$(".fancybox").fancybox({
helpers : {
title: {
@richardegil
richardegil / gist:4090942
Created November 16, 2012 21:10
Carlos - Middle Name
// Middle Initial
<?php if ($middle_intial != '')) {
echo '<h3>' . $first_name . ' ' . $middle_initial . '. ' . $last_name . ', ' . $the_titles . '</h3>';
} else {
echo '<h3>' . $first_name . ' ' . $last_name . ', ' . $the_titles . '</h3>';
}
@richardegil
richardegil / gist:4119147
Created November 20, 2012 16:43
For Carlos - CPT additions
Carlos,
I added a third array to the initial setup of the Faculty cpt.
The file you need to edit is: /includes/cpt/faculty.php
$faculty = register_cuztom_post_type(
'faculty',
array(
'has_archive' => false,
'supports' => array ('title', 'excerpt', 'thumbnail'),