Skip to content

Instantly share code, notes, and snippets.

View celticwebdesign's full-sized avatar

Darren Stevens celticwebdesign

View GitHub Profile
HTML ----
<?php
// slideshow
$rows = get_field('slideshow_repeater');
if($rows) {
echo "<!-- slideshow -->
<div id='slideshow' class='full-width clearfix'>
@celticwebdesign
celticwebdesign / Dev Template Name
Last active April 18, 2017 16:42
Provides quick information for each WordPress page / post template.
// DEVELOPER
function dev_template_name() {
global $template, $post;
$template_array = explode('/',$template);
echo '
<style>
.dev-template-name {position:fixed;bottom:200px;right:10px;background: rgba(255,0,0,0.6);color:#fff;padding:2px 4px;font-size:0.8em;z-index: 100;/*display: none;*/}
</style>
<?php
// If needed to get a specific category
// echo "<pre>";
// var_dump($wp_query->query_vars);
// echo "</pre>";
// echo $wp_query->query_vars['gallery-category'];
$args = array(
'post_type' => 'document',
<?php
$args = array(
'post_type' => 'notices-mariners',
'post_status' => 'publish',
'posts_per_page' => 2,
'meta_key' => 'mariners_date_selected',
'orderby' => 'meta_value_num',
'order' => 'ASC'
);
$taxonomy = 'blog-category';
$terms = get_terms(
$taxonomy,
array(
'hide_empty' => 1,
'parent' => 0
)
);
// 'parent' => 0
if ($terms) {