Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

View File

@@ -0,0 +1,47 @@
<?php
/**
* The template used for displaying "Category Listing" content in page-category-listing.php
*
* The default taxonomy slug is “attachment_tag”. You can select the taxonomy you want by adding
* a query parameter to the URL, e.g., "?taxonomy=attachment_category".
*
* For this page to work well, you should install and activate the Collapse-O-Matic plugin.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
if ( ! empty( $_REQUEST['taxonomy'] ) ) {
$attr = array( 'taxonomy' => $_REQUEST['taxonomy'] );
} else {
$attr = array( 'taxonomy' => 'attachment_tag' );
}
echo mla_taxonomy_terms_list( $attr );
?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->

View File

@@ -0,0 +1,125 @@
<?php
/**
* The template used for displaying "JKEast Dropdown" content in page-jkeast-dropdown.php
*
* The default taxonomy slug is "attachment_tag". You can select the taxonomy you want by adding
* a query parameter to the URL, e.g., "?my_taxonomy=attachment_category".
*
* The default taxonomy term is empty. You must select the term you want by adding
* a query parameter to the URL, e.g., "?my_term=yellow".
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<h1 class="entry-title">
<?php the_title(); ?>
</h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<script>
( function( $ ) {
$(document).ready(function () {
$('div.group').hide();
$('#option0').show();
$('#gallery').change(function () {
var $select = $( this ),
selected = $select.val();
if ( selected === "option0"){
$('div.group').hide();
$('.pgn-btns').show();
$('#option0').show();
} else {
$('div.group').hide();
$('.pgn-btns').hide();
$('#'+ selected).show();
}
})
});
})( jQuery );
</script>
<?php
/**
* Custom Taxonomy Dropdown Control
*
* @since 1.00
*
* @param string Taxonomy slug
* @param string Order by field
* @param string Sort order
* @param string Not used
* @param string HTML name= value
* @param mixed NULL/"Select All" label
* @param mixed NULL/"Select None" label
*
* @return void Echoes HTML for the dropdown control
*/
function custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC', $limit = '-1', $name, $show_option_all = null, $show_option_none = null ) {
$args = array(
'orderby' => $orderby,
'order' => $order,
'exclude' => '120'
);
$terms = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
$name = ( $name ) ? $name : $taxonomy;
$y=0;
if ( $terms ) {
printf( '<select name="%s" id="gallery">', esc_attr( $name ) );
if ( $show_option_all ) {
printf( '<option class="group" value="option0">%s</option>', esc_html( $show_option_all ) );
}
if ( $show_option_none ) {
printf( '<option value="-1">%s</option>', esc_html( $show_option_none ) );
}
foreach ( $terms as $term ) {
$y++;
printf( '<option name="%s" class="group" value="option'.$y.'" >%s</option>', esc_attr( $term->slug ), esc_html( $term->name ) );
}
print( '</select>' );
}
}
custom_taxonomy_dropdown( 'attachment_category', 'date', 'ASC', '5', 'attachment_category', 'Select All');
?>
<?php
$terms = MLAQuery::mla_wp_get_terms("attachment_category", "exclude=120");
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
$xyz=0;
foreach ( $terms as $term ) {
$n = $term->slug;
$xyz++;
?>
<div id="option<?php echo $xyz; ?>" class="group" style="display: none"> <?php echo do_shortcode('[mla_gallery mla_alt_shortcode=gallery orderby="title" link="file" order="DESC" attachment_category="'.$n.'" mla_paginate_current=1]'); ?> </div>
<?php
}
}
?>
<div id="option0" class="group"><?php echo do_shortcode('[mla_gallery mla_alt_shortcode=gallery orderby="title" order="DESC" link="file" post_parent=all posts_per_page=6]'); ?></div>
<div class="pgn-btns">
<div style="clear: both; float: left"> <?php echo do_shortcode('[mla_gallery mla_output="previous_page,first" orderby="title" order="DESC" post_parent=all posts_per_page=6]')?></div>
<div style="float: right"> <?php echo do_shortcode('[mla_gallery mla_output="next_page,last" orderby="title" order="DESC" post_parent=all posts_per_page=6]')?></div>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer>
<!-- .entry-meta -->
</article>
<!-- #post -->

View File

@@ -0,0 +1,149 @@
<?php
/**
* The template used for displaying "JKEast Dropdown" content in page-jkeast-dropdown.php
*
* The default taxonomy slug is "attachment_tag". You can select the taxonomy you want by adding
* a query parameter to the URL, e.g., "?my_taxonomy=attachment_category".
*
* The default taxonomy term is empty. You must select the term you want by adding
* a query parameter to the URL, e.g., "?my_term=yellow".
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<h1 class="entry-title">
<?php the_title(); ?>
</h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<script>
( function( $ ) {
$(document).ready(function () {
var selected = $('#gallery').val();
$('#'+ selected).show();
$('#gallery').change(function () {
var $select = $( this ),
selected = $select.val();
if ( selected === "option0"){
$('div.group').hide();
$('#option0').show();
} else {
$('div.group').hide();
$('#'+ selected).show();
}
})
});
})( jQuery );
</script>
<?php
/**
* Custom Taxonomy Dropdown Control
*
* @since 1.00
*
* @param string Taxonomy slug
* @param string Order by field
* @param string Sort order
* @param string Not used
* @param string HTML name= value
* @param mixed NULL/"Select All" label
* @param mixed NULL/"Select None" label
* @param integer Index of the inital selection
*
* @return void Echoes HTML for the dropdown control
*/
function custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC', $limit = '-1', $name, $show_option_all = null, $show_option_none = null, $selected=0 ) {
$args = array(
'orderby' => $orderby,
'order' => $order,
'exclude' => '120'
);
$terms = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
$name = ( $name ) ? $name : $taxonomy;
$y=0;
if ( $terms ) {
printf( '<select name="%s" id="gallery">', esc_attr( $name ) );
if ( $show_option_all ) {
printf( '<option class="group" value="option0">%s</option>', esc_html( $show_option_all ) );
}
if ( $show_option_none ) {
printf( '<option value="-1">%s</option>', esc_html( $show_option_none ) );
}
foreach ( $terms as $term ) {
$y++;
if ( $selected == $y ) {
printf( '<option name="%s" class="group" value="option'.$y.'" selected>%s</option>', esc_attr( $term->slug ), esc_html( $term->name ) );
} else {
printf( '<option name="%s" class="group" value="option'.$y.'" >%s</option>', esc_attr( $term->slug ), esc_html( $term->name ) );
}
}
print( '</select>' );
}
}
// Find the most recent gallery pagination parameter,
// which determines the current dropdown selection.
$page_tag = 'mla_current_';
$current_uri = $_SERVER['REQUEST_URI'];
$pos = strrpos( $current_uri, $page_tag );
if ( $pos ) {
$base_uri = substr( $current_uri, 0, strpos( $current_uri, '?' ) );
$selected = substr( $current_uri, $pos + strlen( $page_tag ) );
// Keep only the most recent pagination value
$_SERVER['REQUEST_URI'] = $base_uri . '?' . $page_tag . $selected;
$selected = absint( substr( $current_uri, $pos + strlen( $page_tag ) ) );
} else {
$selected = 0;
}
custom_taxonomy_dropdown( 'attachment_category', 'date', 'ASC', '5', 'attachment_category', 'Select All', NULL, $selected );
?>
<?php
$terms = MLAQuery::mla_wp_get_terms("attachment_category", "exclude=120");
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
$xyz=0;
foreach ( $terms as $term ) {
$n = $term->slug;
$page_parameter = $page_tag . ++$xyz;
?>
<div id="option<?php echo $xyz; ?>" class="group" style="display: none"> <?php echo do_shortcode('[mla_gallery mla_alt_shortcode=gallery orderby="title" link="file" order="DESC" post_parent=all posts_per_page=3 attachment_category="'.$n.'" mla_page_parameter=' . $page_parameter . ']'); ?>
<div class="pgn-btns<?php echo $xyz; ?>">
<div style="clear: both; float: left"> <?php echo do_shortcode('[mla_gallery mla_output="previous_page,first" orderby="title" order="DESC" post_parent=all posts_per_page=3 attachment_category="'.$n.'" mla_page_parameter=' . $page_parameter . ']')?></div>
<div style="float: right"> <?php echo do_shortcode('[mla_gallery mla_output="next_page,last" orderby="title" order="DESC" post_parent=all posts_per_page=3 attachment_category="'.$n.'" mla_page_parameter=' . $page_parameter . ']')?></div>
</div>
</div>
<?php
}
}
?>
<div id="option0" class="group" style="display: none"><?php echo do_shortcode('[mla_gallery mla_alt_shortcode=gallery orderby="title" order="DESC" link="file" post_parent=all posts_per_page=6 mla_page_parameter=' . $page_tag . '0]'); ?>
<div class="pgn-btns">
<div style="clear: both; float: left"> <?php echo do_shortcode('[mla_gallery mla_output="previous_page,first" orderby="title" order="DESC" post_parent=all posts_per_page=6 mla_page_parameter=' . $page_tag . '0]')?></div>
<div style="float: right"> <?php echo do_shortcode('[mla_gallery mla_output="next_page,last" orderby="title" order="DESC" post_parent=all posts_per_page=6 mla_page_parameter=' . $page_tag . '0]')?></div>
</div>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer>
<!-- .entry-meta -->
</article>
<!-- #post -->

View File

@@ -0,0 +1,63 @@
<?php
/**
* The template used for displaying the "Latest Images" content in page-latest-images.php
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* The original static page that brought us here
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
/*
* Adjust these parameters if you want more than one page, e.g.,
* $images_per_page = 25;
* $maximum_images = 100;
* will produce four pages of twenty five images each. Make sure you have
* more images than whatever you code in $maximum_images
*/
$images_per_page = 25;
$maximum_images = 25;
/*
* Display the most recent images
* An alternate orderby="ID DESC" may offer better performance
*/
echo do_shortcode( sprintf( '[mla_gallery orderby="date DESC" numberposts=%1$s post_parent=all update_post_term_cache=false]', $images_per_page ) );
?>
<?php if ( $maximum_images > $images_per_page ) : ?>
<div class="pagination loop-pagination">
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="previous_page,first" numberposts="%2$s" mla_link_class="prev page-numbers" mla_link_text="{Page {+current_page+} of {+last_page+}}"]', $maximum_images, $images_per_page ) ); ?>
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="paginate_links,prev_next" numberposts="%2$s" mla_link_class="page-numbers" mla_prev_text="&#9668;" mla_next_text="&#9658;"]', $maximum_images, $images_per_page ) ); ?>
</div>
<!-- This alternative is basic Previous/Next pagination
<div class="pagination loop-pagination">
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="previous_page" numberposts="%2$s" mla_link_class="prev page-numbers" mla_link_text="<span class=\'meta-nav\'>&#9668;</span> Previous"]', $maximum_images, $images_per_page ) ); ?>
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="next_page" numberposts="%2$s" mla_link_class="next page-numbers" mla_link_text="Next <span class=\'meta-nav\'>&#9658;</span>"]', $maximum_images, $images_per_page ) ); ?>
</div>
This alternative is basic Previous/Next pagination -->
<?php endif; ?>
<?php //wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->

View File

@@ -0,0 +1,38 @@
<?php
/**
* The template for displaying posts in the Image post format,
* called from the taxonomy.php template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<h1><?php the_title(); ?></h1>
<h2><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo get_the_date(); ?></time></h2>
</a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->

View File

@@ -0,0 +1,25 @@
<?php
/**
* The template for displaying posts in the Image post format,
* called from the taxonomy.php template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.91
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $wp_query
*/
global $wp_query;
?>
<header class="archive-header">
<h1 class="archive-title">
MLA Gallery for <?php echo $wp_query->query_vars['term']; ?> in <?php echo $wp_query->query_vars['taxonomy']; ?>
<?php echo do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" mla_caption="{+title+}" mla_debug=false]', $wp_query->query_vars['taxonomy'], $wp_query->query_vars['term'] ) ); ?>
</h1>
</header>

View File

@@ -0,0 +1,129 @@
<?php
/**
* The template used for displaying "attachment page" content in page-single-image.php
*
* You must select the attachment you want by adding a query parameter
* to the URL, e.g., "?post_id=5" where 5 is the ID of the attachment.
*
* The global $post variable contains the post object of the calling page.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* The original static page that brought us here
*
* @global $post
*/
global $post;
?>
<?php
/*
* Emulate the logic in edit_post_link(), because we want to edit the static page, not the attachment
*/
$before = '<span class="edit-link">';
$url = get_edit_post_link( $post->ID );
$link = $link = '<a class="post-edit-link" href="' . $url . '">' . __( 'Edit', 'mla-child-theme' ) . '</a>';
$after = '</span>';
$edit_post_link = $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
/*
* The attachment's ID must be set as an HTML query parameter
*/
$post_id = isset( $_REQUEST['post_id'] ) ? $_REQUEST['post_id'] : 0;
if ( $post_id ) {
$query = new WP_Query( array( 'p' => $post_id, 'post_type' => 'attachment', 'post_status' => 'inherit', 'orderby' => 'none', 'update_post_term_cache' => false ) );
} else {
echo '<h1>ERROR: No Post ID</h1>';
the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) );
return;
}
if ( $query->have_posts() ) {
$page = $post; // in case we need it later
$query->the_post(); // simulate "the loop"
} else {
echo '<h1>ERROR: No Attachment Object</h1>';
the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) );
return;
}
?>
<article id="post-<?php the_ID(); ?>" class="post-<?php the_ID(); ?> attachment type-attachment status-inherit hentry">
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<footer class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> .', 'twentytwelve' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( wp_get_attachment_url() ),
$metadata['width'],
$metadata['height']
);
?>
<?php echo $edit_post_link; ?>
</footer><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
/**
* Filter the image attachment size to use.
*
* @since Twenty Twelve 1.0
*
* @param array $size {
* @type int The attachment height in pixels.
* @type int The attachment width in pixels.
* }
*/
$attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
echo wp_get_attachment_image( $post->ID, $attachment_size );
?></a>
<?php if ( ! empty( $post->post_excerpt ) ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div>
<?php endif; ?>
</div><!-- .attachment -->
</div><!-- .entry-attachment -->
<div class="entry-description">
<?php echo esc_attr( $post->post_content ); ?><br />
&nbsp;
</div><!-- .entry-description -->
</div><!-- .entry-content -->
<div class="entry-terms">
<?php
$attr = array();
/*
* You can change the default taxonomy slug by adding a query variable, e.g.,
* "?taxonomy=attachment_category"
*/
if ( ! empty( $_REQUEST['taxonomy'] ) ) {
$attr['taxonomy'] = $_REQUEST['taxonomy'];
}
/*
* You can change the default destination page by adding a query variable, e.g.,
* "?page_path=some-other-page"
*/
if ( ! empty( $_REQUEST['page_path'] ) ) {
$attr['page_path'] = $_REQUEST['page_path'];
}
mla_custom_terms_list( get_the_ID(), $attr ); // Child theme function
?>
</div><!-- .entry-terms -->
<footer class="entry-meta">
<?php echo $edit_post_link; ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->

View File

@@ -0,0 +1,84 @@
<?php
/**
* The template used for displaying "Tag Gallery" content in page-tag-gallery.php
*
* The default taxonomy slug is "attachment_tag". You can select the taxonomy you want by adding
* a query parameter to the URL, e.g., "?my_taxonomy=attachment_category".
*
* The default taxonomy term is empty. You must select the term you want by adding
* a query parameter to the URL, e.g., "?my_term=yellow".
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
$attr = array(
'page' => '/single-image/',
'taxonomy' => 'attachment_tag',
'term' => '',
'post_mime_type' => 'image',
'posts_per_page' =>1,
'current_page' => 1
);
/*
* You can change the defaults by adding query variables, e.g.,
* "?my_taxonomy=attachment_category"
* "?my_term=term-slug"
*/
if ( ! empty( $_REQUEST['my_taxonomy'] ) ) {
$attr['taxonomy'] = $_REQUEST['my_taxonomy'];
}
if ( ! empty( $_REQUEST['my_term'] ) ) {
$attr['term'] = $_REQUEST['my_term'];
}
if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
$attr['post_mime_type'] = $_REQUEST['post_mime_type'];
}
if ( ! empty( $_REQUEST['posts_per_page'] ) ) {
$attr['posts_per_page'] = $_REQUEST['posts_per_page'];
}
if ( ! empty( $_REQUEST['mla_paginate_current'] ) ) {
$attr['current_page'] = $_REQUEST['mla_paginate_current'];
}
$count = mla_paginated_term_gallery( $attr ); // Child theme function
?>
<div class="pagination loop-pagination">
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="previous_page,first" numberposts="%2$s" mla_link_class="prev page-numbers" mla_link_text="{Page {+current_page+} of {+last_page+}}"]', $count, $attr['posts_per_page'] ) ); ?>
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="paginate_links,prev_next" numberposts="%2$s" mla_link_class="page-numbers" mla_prev_text="&#9668;" mla_next_text="&#9658;"]', $count, $attr['posts_per_page'] ) ); ?>
</div>
<!-- This alternative is basic Previous/Next pagination
<div class="pagination loop-pagination">
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="previous_page" numberposts="%2$s" mla_link_class="prev page-numbers" mla_link_text="<span class=\'meta-nav\'>&#9668;</span> Previous"]', $count, $attr['posts_per_page'] ) ); ?>
<?php echo do_shortcode( sprintf( '[mla_gallery mla_paginate_rows="%1$s" mla_output="next_page" numberposts="%2$s" mla_link_class="next page-numbers" mla_link_text="Next <span class=\'meta-nav\'>&#9658;</span>"]', $count, $attr['posts_per_page'] ) ); ?>
</div>
This alternative is basic Previous/Next pagination -->
<?php //wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->

View File

@@ -0,0 +1,120 @@
<?php
/**
* The template used for displaying "Tosca30 Dropdown" content in page-tosca30-dropdown.php
*
* Replaces the wp_list_categories() item count with an accurate, padded count of the
* attachments assigned to each term.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<h1 class="entry-title">
<?php the_title(); ?>
</h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
/**
* Class MNA_Pad_Counts_Walker adds accurate, padded attachment counts to taxonomy terms.
*
* Class Walker is defined in /wp-includes/class-wp-walker.php
* Class Walker_Category is defined in /wp-includes/category-template.php
*/
class MNA_Pad_Counts_Walker extends Walker_Category {
/**
* MLA Terms
*
* @var array
*/
private $mla_terms = array();
/**
* Constructor - set the MLA Terms.
*
* @param string Taxonomy name/slug.
*/
function __construct( $taxonomy ) {
$attr = array (
'taxonomy' => $taxonomy,
'pad_counts' => 'true',
);
$terms = MLAShortcodes::mla_get_terms( $attr );
unset( $terms['found_rows'] );
foreach ( $terms as $term ) {
$this->mla_terms[ $term->term_taxonomy_id ] = $term->count;
}
}
/**
* Start the element output.
*
* @see Walker::start_el()
*
* @param string Passed by reference. Used to append additional content.
* @param object Taxonomy data object.
* @param int Depth of category in reference to parents. Default 0.
* @param array An array of arguments. @see wp_list_categories()
* @param int ID of the current category.
*/
function start_el( &$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0 ) {
if ( isset( $this->mla_terms[ $taxonomy_object->term_taxonomy_id ] ) ) {
$taxonomy_object->count = $this->mla_terms[ $taxonomy_object->term_taxonomy_id ];
}
parent::start_el( $output, $taxonomy_object, $depth, $args, $id );
}
}// Class MNA_Pad_Counts_Walker
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
foreach ( $taxonomies as $taxonomy ) {
echo '<h3>' . $taxonomy->labels->name . '</h3>';
unset( $checklist_walker );
$checklist_walker = new MNA_Pad_Counts_Walker( $taxonomy->name );
$args = array(
'taxonomy' => $taxonomy->name,
'hierarchical' => 1,
'hide_empty' => 0,
'pad_counts' => 1,
'show_count' => 1,
'title_li' => '',
'walker' => $checklist_walker,
);
echo '<h4>wp_list_categories</h4>';
wp_list_categories( $args );
echo '<h4>mla_tag_cloud</h4>';
echo '<table><tr><td>pad_counts=false<br>';
echo do_shortcode( "[mla_tag_cloud taxonomy={$taxonomy->name} mla_output=list pad_counts=false]" );
echo '</td><td>pad_counts=true<br>';
echo do_shortcode( "[mla_tag_cloud taxonomy={$taxonomy->name} mla_output=list pad_counts=true]" );
echo '</td></tr></table>';
}
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer>
<!-- .entry-meta -->
</article>
<!-- #post -->

View File

@@ -0,0 +1,340 @@
<?php
/**
* MLA Child for Twenty Twelve functions and definitions
*
* Sets up the theme and provides some helper functions, which are used
* in the theme as custom template tags. Others are attached to action and
* filter hooks in WordPress to change core functionality.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.01
* @since MLA 1.80
*/
/*
* Remove the link rel='prev' and link rel='next' tags in the wp_head();
* this prevents a couple of "query_posts" calls.
* The other remove_action statements have been suggested in various support topics.
*/
if ( ! is_admin() ) {
//remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed
//remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds
//remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
//remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post. OBSOLETE?
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // Display relational links for the posts adjacent to the current post.
//remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version
//remove_action( 'wp_head', 'rel_canonical' ); // Display the canonical link fo a singular page
}
/**
* Loads the text domain(s) for the mla-child-theme, from the WordPress language directory
* and/or from the theme's own directory.
*
* @return void
*/
function mla_after_setup_theme_action() {
$domain = 'mla-child-theme';
load_theme_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain );
load_theme_textdomain( $domain, get_stylesheet_directory() . '/languages' );
//the third call is made in the parent theme twentytwelve_setup() function
//load_theme_textdomain( $domain, get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'mla_after_setup_theme_action' );
/**
* Customize the <title> tag content for the Tag Gallery and Single Image pages
*
* @param string The default page title
* @param string $sep How to separate the various items within the page title
* @param string $seplocation Optional. Direction to display title, 'right'.
*
* @return string updated title value
*/
function mla_wp_title_filter( $title, $sep, $seplocation ) {
$sep = " {$sep} ";
if ( is_page() ) {
$page = single_post_title( '', false );
/*
* Match specific page titles and replace the default, page title,
* with more interesting term or file information.
*/
if ( 'Tag Gallery' == $page ) {
$taxonomy = isset( $_REQUEST['my_taxonomy'] ) ? $_REQUEST['my_taxonomy'] : NULL;
$slug = isset( $_REQUEST['my_term'] ) ? $_REQUEST['my_term'] : NULL;
if ( $taxonomy && $slug ) {
$term = get_term_by( 'slug', $slug, $taxonomy );
return $term->name . $sep;
}
} elseif ( 'Single Image' == $page ) {
$post_id = isset( $_REQUEST['post_id'] ) ? $_REQUEST['post_id'] : 0;
if ( $post_id ) {
$file = get_attached_file( $post_id );
$pathinfo = pathinfo( $file );
return $pathinfo['basename'] . $sep;
}
}
} // is_page
return $title;
}
add_filter( 'wp_title', 'mla_wp_title_filter', 10, 3 );
/**
* Generate a taxonomy- and term-specific [mla_gallery]
*
* @param array Attributes of the function: taxonomy, term
*
* @return void echoes HTML <h3>, <p> and <a> tags
*/
function mla_tag_gallery( $attr = NULL ) {
/*
* Make sure $attr is an array, even if it's empty
*/
if ( empty( $attr ) ) {
$attr = array();
} elseif ( is_string( $attr ) ) {
$attr = shortcode_parse_atts( $attr );
}
/*
* Create the PHP variables we need
*/
extract( shortcode_atts( array(
'taxonomy' => 'attachment_tag',
'term' => ''
), $attr ) );
/*
* Convert to objects for validation and labels
*/
$taxonomy = get_taxonomy( $taxonomy );
$term = get_term_by( 'slug', $term, $taxonomy->name );
if ( empty( $taxonomy ) ) {
$output = __( 'Taxonomy does not exist.', 'mla-child-theme' );
}
elseif ( empty( $term ) ) {
$output = __( 'Term does not exist.', 'mla-child-theme' );
}
else {
/* translators: 1: term name, 2: taxonomy label */
$output = '<h3>' . sprintf( __( 'Gallery for term "%1$s" in taxonomy "%2$s"', 'mla-child-theme' ), $term->name, $taxonomy->labels->name ) . '</h3>';
$output .= '<p>' . do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" post_mime_type=all mla_nolink_text="No items found" ]', $taxonomy->name, $term->slug ) . "</p>\r\n" );
} // ! empty
echo $output;
}
/**
* Generate a taxonomy- and term-specific [mla_gallery], limited by current_page and posts_per_page
*
* This function uses $wpdb functions for efficiency.
*
* @param array Attributes of the function: page, taxonomy, term, post_mime_type, posts_per_page, current_page
*
* @return integer number of posts matching taxonomy & term, before LIMIT. echoes HTML <h3>, <p> and <a> tags
*/
function mla_paginated_term_gallery( $attr = NULL ) {
global $wpdb;
/*
* Make sure $attr is an array, even if it's empty
*/
if ( empty( $attr ) ) {
$attr = array();
} elseif ( is_string( $attr ) ) {
$attr = shortcode_parse_atts( $attr );
}
/*
* Create the PHP variables we need
*/
extract( shortcode_atts( array(
'page' => NULL,
'taxonomy' => 'attachment_tag',
'term' => '',
'post_mime_type' => 'all',
'posts_per_page' =>10,
'current_page' => 1
), $attr ) );
/*
* Convert to objects for validation and labels
*/
$taxonomy = get_taxonomy( $taxonomy );
$term = get_term_by( 'slug', $term, $taxonomy->name );
if ( empty( $taxonomy ) ) {
echo __( 'Taxonomy does not exist.', 'mla-child-theme' );
return;
}
elseif ( empty( $term ) ) {
echo __( 'Term does not exist.', 'mla-child-theme' );
return;
}
$offset = absint( $current_page - 1 ) * $posts_per_page;
if ( 'all' == strtolower( $post_mime_type ) ) {
$count = $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->term_relationships . ' WHERE ( term_taxonomy_id = ' . $term->term_taxonomy_id . ' )' );
$posts = implode( ',', $wpdb->get_col( 'SELECT object_id FROM ' . $wpdb->term_relationships . ' WHERE ( term_taxonomy_id = ' . $term->term_taxonomy_id . ' ) LIMIT ' . $offset . ', ' . $posts_per_page ) );
} else {
/*
* $posts contains all post types, so we further limit the results to select attachments of the
* desired MIME type, then apply the limit criteria.
*/
$mime_where = wp_post_mime_type_where( $post_mime_type, 'p' );
$posts = implode( ',', $wpdb->get_col( 'SELECT object_id FROM ' . $wpdb->term_relationships . ' WHERE ( term_taxonomy_id = ' . $term->term_taxonomy_id . ' )' ) );
$count = $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->posts . ' AS p WHERE ( p.ID IN ( ' . $posts . ' )' . $mime_where . ')' );
$posts = implode( ',', $wpdb->get_col( 'SELECT p.ID FROM ' . $wpdb->posts . ' as p WHERE ( p.ID IN ( ' . $posts . ' )' . $mime_where . ') LIMIT ' . $offset . ', ' . $posts_per_page ) );
}
$href = empty( $page ) ? '{+link_url+}' : "{+site_url+}{$page}";
/* translators: 1: term name, 2: taxonomy label */
$output = '<h3>' . sprintf( __( 'Gallery for term "%1$s" in taxonomy "%2$s"', 'mla-child-theme' ), $term->name, $taxonomy->labels->name ) . '</h3>';
$output .= '<p>' . do_shortcode( sprintf( '[mla_gallery ids="%1$s" post_mime_type="%2$s" mla_paginate_current=1 mla_nolink_text="No items found" update_post_term_cache="false" mla_link_href="%3$s?post_id={+attachment_ID+}"]', $posts, $post_mime_type, $href ) . "</p>\r\n" );
echo $output;
return $count;
}
/**
* Generate a list of taxonomy- and term-specific links to the page of your choice,
* listing the terms assigned to a specific post or Media Library item.
*
* @param integer ID of the post/page to generate terms for
* @param array Attributes of the function: site_url, page_url, taxonomy
*
* @return void echoes HTML <h3>, <p> and <a> tags
*/
function mla_custom_terms_list( $ID, $attr = NULL ) {
/*
* Make sure $attr is an array, even if it's empty
*/
if ( empty( $attr ) ) {
$attr = array();
} elseif ( is_string( $attr ) ) {
$attr = shortcode_parse_atts( $attr );
}
/*
* Create the three PHP variables we need
*/
extract( shortcode_atts( array(
'site_url' => site_url(),
'page_path' => '/tag-gallery/',
'taxonomy' => 'attachment_tag',
), $attr ) );
/*
* Get the terms associated with the current attachment.
* Return nothing if there are no terms associated with the attachment.
*/
$terms = get_the_terms( $ID, $taxonomy );
if ( empty( $terms ) ) {
return '';
}
/* translators: 1: taxonomy slug */
$output = '<h3>' . sprintf( __( 'Terms list for taxonomy: %1$s', 'mla-child-theme' ), $taxonomy ) . '</h3>';
/* translators: 1: term name */
$title = sprintf( __( 'Gallery for %1$s', 'mla-child-theme' ), $taxonomy );
foreach ( $terms as $term ) {
$output .= '<p>' . sprintf( '<a href=%1$s%2$s?my_taxonomy=%3$s&my_term=%4$s title="%5$s">%6$s</a>', $site_url, $page_path, $taxonomy, $term->slug, $title, $term->name ) . "</p>\n";
}// foreach term
echo $output;
}
/**
* Generate a list of taxonomy- and term-specific links to the page of your choice.
* Best used with the Collapse-O-Matic plugin, which uses the [expand] shortcode to
* display an "accordian-style" list.
*
* @param array Attributes of the function: taxonomy
*
* @return string HTML <h3>, <p> and <a> tags
*/
function mla_taxonomy_terms_list( $attr = NULL ) {
/*
* Make sure $attr is an array, even if it's empty
*/
if ( empty( $attr ) ) {
$attr = array();
} elseif ( is_string( $attr ) ) {
$attr = shortcode_parse_atts( $attr );
}
/*
* Create the PHP variables we need
*/
extract( shortcode_atts( array(
'taxonomy' => 'attachment_tag',
), $attr ) );
$terms = MLAQuery::mla_wp_get_terms( $taxonomy );
if ( empty( $terms ) ) {
return __( 'There are no non-empty taxonomy values', 'mla-child-theme' );
}
/* translators: 1: taxonomy slug */
$output = '<h3>' . sprintf( __( 'Terms list for taxonomy: %1$s', 'mla-child-theme' ), $taxonomy ) . '</h3>';
foreach ( $terms as $term ) {
$output .= '<p>' . do_shortcode( sprintf( '[expand title="%1$s" tag="div" trigclass="level-2 third" targclass="level-2-targ"][mla_gallery %2$s="%3$s" post_mime_type=all mla_nolink_text="%4$s" size=icon mla_style=table mla_markup=table columns=1][/expand]', $term->name, $taxonomy, $term->slug, __( 'No items found', 'mla-child-theme' ) ) . "</p>\r\n" );
}// foreach term
return $output;
}
/**
* Insert thumbnail image tags for Facebook, Twitter, etc.
*
* @return void echoes HTML <meta> tags
*/
function mla_insert_social_tags() {
if ( is_page() ) {
global $post;
if ( empty( $post->post_content ) ) {
return;
}
$count = preg_match( '/\[mla_gallery.*attachment_category="([^\"]*)\"/', $post->post_content, $mla_matches );
if ( $count ) {
$matched_category = $mla_matches[1]; // for preg_match
$gallery = do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" size=full link=none mla_style=none posts_per_page=5]', 'attachment_category', $matched_category ) );
$count = preg_match_all( '/src=\"([^\"]*)\"/', $gallery, $mla_matches );
if ( $count ) {
foreach ( $mla_matches[1] as $match ) {
echo sprintf( '<meta property="og:image" content="%1$s" />', $match ) . "\n";
}
echo sprintf( '<meta name="twitter:image:src" content="%1$s" />', $mla_matches[1][0] ) . "\n";
}
return;
} // found mla_gallery
$count = preg_match( '/\[gallery.*ids="([^\"]*)\"/', $post->post_content, $mla_matches );
if ( $count ) {
$matched_posts = $mla_matches[1]; // for preg_match
$gallery = do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" size=full link=none mla_style=none posts_per_page=5]', 'ids', $matched_posts ) );
$count = preg_match_all( '/src=\"([^\"]*)\"/', $gallery, $mla_matches );
if ( $count ) {
foreach ( $mla_matches[1] as $match ) {
echo sprintf( '<meta property="og:image" content="%1$s" />', $match ) . "\n";
}
echo sprintf( '<meta name="twitter:image:src" content="%1$s" />', $mla_matches[1][0] ) . "\n";
}
}
} // found gallery
}
?>

View File

@@ -0,0 +1,71 @@
<?php
/**
* The Header template for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
* The mla-child version has code to insert thumbnail image tags for Facebook, Twitter, etc.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
?>
<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php
/*
* Code to insert thumbnail image tags for Facebook, Twitter, etc.
*/
if ( function_exists( 'mla_insert_social_tags' ) ) {
mla_insert_social_tags();
}
?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<hgroup>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav><!-- #site-navigation -->
<?php if ( get_header_image() ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>
</header><!-- #masthead -->
<div id="main" class="wrapper">

View File

@@ -0,0 +1,147 @@
<?php
/**
* The template for displaying "Attachment Posts" for $mimetype = "image",
* a more specific alternative to the generic "attachment.php" template.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<footer class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( wp_get_attachment_url() ),
$metadata['width'],
$metadata['height'],
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
get_the_title( $post->post_parent )
);
?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
<?php if ( isset( $_REQUEST['term_slug'] ) ): ?>
<nav id="image-navigation" class="navigation" role="navigation">
<span class="previous-image"><?php echo do_shortcode('[mla_gallery tag=' . $_REQUEST['term_slug'] . ' order=ASC mla_output="previous_link" mla_link_text="&larr; Previous" mla_link_href={+link_url+}?term_slug={+query:tag+}]')?></span>
<span class="next-image"><?php echo do_shortcode('[mla_gallery tag=' . $_REQUEST['term_slug'] . ' order=ASC mla_output="next_link" mla_link_text="Next &rarr;" mla_link_href={+link_url+}?term_slug={+query:tag+}]')?></span>
</nav><!-- #image-navigation -->
<?php else: ?>
<nav id="image-navigation" class="navigation" role="navigation">
<span class="previous-image"><?php previous_image_link( false, __( '&larr; Previous', 'twentytwelve' ) ); ?></span>
<span class="next-image"><?php next_image_link( false, __( 'Next &rarr;', 'twentytwelve' ) ); ?></span>
</nav><!-- #image-navigation -->
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<?php
/*
* Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
* or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
*/
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
foreach ( $attachments as $k => $attachment ) :
if ( $attachment->ID == $post->ID )
break;
endforeach;
$k++;
// If there is more than 1 attachment in a gallery
if ( count( $attachments ) > 1 ) :
if ( isset( $attachments[ $k ] ) ) :
// get the URL of the next image attachment
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
else :
// or get the URL of the first image attachment
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
endif;
else :
// or, if there's only 1 image, get the URL of the image
$next_attachment_url = wp_get_attachment_url();
endif;
?>
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
/**
* Filter the image attachment size to use.
*
* @since Twenty Twelve 1.0
*
* @param array $size {
* @type int The attachment height in pixels.
* @type int The attachment width in pixels.
* }
*/
$attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
echo wp_get_attachment_image( $post->ID, $attachment_size );
?></a>
<?php if ( ! empty( $post->post_excerpt ) ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div>
<?php endif; ?>
</div><!-- .attachment -->
</div><!-- .entry-attachment -->
<div class="entry-description">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-description -->
</div><!-- .entry-content -->
<div class="entry-terms">
<?php
$attr = array();
/*
* You can change the default taxonomy slug by adding a query variable, e.g.,
* "?taxonomy=attachment_category"
*/
if ( ! empty( $_REQUEST['taxonomy'] ) ) {
$attr['taxonomy'] = $_REQUEST['taxonomy'];
}
/*
* You can change the default destination page by adding a query variable, e.g.,
* "?page_path=some-other-page"
*/
if ( ! empty( $_REQUEST['page_path'] ) ) {
$attr['page_path'] = $_REQUEST['page_path'];
}
mla_custom_terms_list( get_the_ID(), $attr ); // Child theme function
?>
</div><!-- .entry-terms -->
</article><!-- #post -->
<?php comments_template(); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>

View File

@@ -0,0 +1,138 @@
# Copyright (C) 2014 the WordPress team
# This file is distributed under the GNU General Public License v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: MLA Child Theme for Twenty Twelve 1.3\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentytwelve\n"
"POT-Creation-Date: 2014-03-25 12:25-0800\n"
"PO-Revision-Date: 2014-03-25 12:25-0800\n"
"Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
"Language-Team: David Lingren <david@fairtradejudaica.org>\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-KeywordsList: __;_e;_ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
"_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../content-category-listing.php:34 ../image.php:103
msgid "Pages:"
msgstr ""
#: ../content-category-listing.php:37 ../content-media.php:28
#: ../content-tag-gallery.php:69 ../image.php:38
msgid "Edit"
msgstr ""
#: ../content-media.php:15
msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
msgstr ""
#: ../content-media.php:25
msgid "Leave a reply"
msgstr ""
#: ../content-media.php:25
msgid "1 Reply"
msgstr ""
#: ../content-media.php:25
msgid "% Replies"
msgstr ""
#: ../functions.php:60 ../functions.php:111
msgid "Taxonomy does not exist."
msgstr ""
#: ../functions.php:63 ../functions.php:115
msgid "Term does not exist."
msgstr ""
#. translators: 1: term name, 2: taxonomy label
#: ../functions.php:67 ../functions.php:137
#, php-format
msgid "Gallery for term \"%1$s\" in taxonomy \"%2$s\""
msgstr ""
#. translators: 1: taxonomy slug
#: ../functions.php:179 ../functions.php:219
#, php-format
msgid "Terms list for taxonomy: %1$s"
msgstr ""
#. translators: 1: term name
#: ../functions.php:181
#, php-format
msgid "Gallery for %1$s"
msgstr ""
#: ../functions.php:215
msgid "There are no non-empty taxonomy values"
msgstr ""
#: ../functions.php:221
msgid "No items found"
msgstr ""
#: ../header.php:52
msgid "Menu"
msgstr ""
#: ../header.php:53
msgid "Skip to content"
msgstr ""
#: ../image.php:27
#, php-format
msgid ""
"<span class=\"meta-prep meta-prep-entry-date\">Published </span> <span class="
"\"entry-date\"><time class=\"entry-date\" datetime=\"%1$s\">%2$s</time></"
"span> at <a href=\"%3$s\" title=\"Link to full-size image\">%4$s &times; "
"%5$s</a> in <a href=\"%6$s\" title=\"Return to %7$s\" rel=\"gallery\">%8$s</"
"a>."
msgstr ""
#: ../image.php:42
msgid "&larr; Previous"
msgstr ""
#: ../image.php:43
msgid "Next &rarr;"
msgstr ""
#: ../taxonomy.php:36
#, php-format
msgid "Daily Archives: %s"
msgstr ""
#: ../taxonomy.php:38
#, php-format
msgid "Monthly Archives: %s"
msgstr ""
#: ../taxonomy.php:38
msgctxt "monthly archives date format"
msgid "F Y"
msgstr ""
#: ../taxonomy.php:40
#, php-format
msgid "Yearly Archives: %s"
msgstr ""
#: ../taxonomy.php:40
msgctxt "yearly archives date format"
msgid "Y"
msgstr ""
#: ../taxonomy.php:42
msgid "Media Archives"
msgstr ""
#: ../taxonomy.php:44
msgid "Archives"
msgstr ""

View File

@@ -0,0 +1,30 @@
<?php
/**
* The template for displaying the "Category Listing" page, which
* must be defined as a static WordPress "Page" post type.
*
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'category-listing' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,30 @@
<?php
/**
* The template for displaying the "JKEast Dropdown" page, which
* must be defined as a static WordPress "Page" post type.
*
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'jkeast-dropdown' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,37 @@
<?php
/**
* The template for displaying the "Latest Images" page, which
* must be defined as a static WordPress "Page" post type.
*
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'latest-images' ); ?>
<?php //comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,46 @@
<?php
/**
* The template used for displaying "attachment page" content
*
* You must define a WordPress static page "Single Image", which can be
* empty but must exist to trigger this template.
*
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* You must select the attachment you want by adding a query parameter
* to the URL, e.g., "?post_id=5" where 5 is the ID of the attachment.
*
* The global $post variable contains the post object of the calling page.
* * The template for displaying the "Tag Gallery" page, which
* must be defined as a static WordPress "Page" post type.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
/**
* Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
*
* @global $post
*/
global $post;
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'single-image' ); ?>
<?php //comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,30 @@
<?php
/**
* The template for displaying the "Tag Gallery" page, which
* must be defined as a static WordPress "Page" post type.
*
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'tag-gallery' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,30 @@
<?php
/**
* The template for displaying the "Tosca30 Dropdown" page, which
* must be defined as a static WordPress "Page" post type.
*
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'tosca30-dropdown' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,59 @@
/**
* This child theme contains changes and enhancements to the WordPress Twenty Twelve
* theme, which is used for all MLA testing and development. The material in this
* child theme was inspired/generated by topics raised in the MLA support forum.
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.03
* @since MLA 1.80
*/
/*
Theme Name: MLA Child for Twenty Twelve
Theme URI: http://davidlingren.com/
Description: Enhancements to the baseline theme, generated in response to MLA support forum topics.
Author: David Lingren
Author URI: http://davidlingren.com/
Template: twentytwelve
Version: 1.03
Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, GPS, PDF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums, lightroom, photoshop, MIME, mime-type, icon, upload, file extensions
Text Domain: mla-child-theme
Domain Path: /languages
Copyright 2011-2014 David Lingren
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You can get a copy of the GNU General Public License by writing to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
@import url("../twentytwelve/style.css");
/* HTML ELEMENTS - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* HEADER - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* MAIN DROP-DOWN NAVIGATION - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* CONTENT - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* SIDEBAR - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* FOOTER - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* CUSTOMIZATIONS FOR SPECIFIC PAGES - - - - - - - - - - - - - - - - - - - - - - - */
/* home ----------------- */
/* blog---------------- */

View File

@@ -0,0 +1,80 @@
<?php
/**
* The template for displaying Custom Taxonomy Archive pages
*
* Twenty Twelve already has tag.php for Tag archives and category.php for Category archives.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package Media Library Assistant
* @subpackage MLA_Child_Theme
* @version 1.00
* @since MLA 1.80
*/
get_header(); ?>
<?php
global $wp_query;
$is_media_archive = in_array( $wp_query->query_vars['taxonomy'], array( 'attachment_category', 'attachment_tag' ) );
if ( $is_media_archive ) {
if ( isset( $_REQUEST['use_mla_gallery'] ) ) {
$use_mla_gallery = true;
} else {
$use_mla_gallery = false;
$args = array_merge( $wp_query->query_vars, array( 'post_type' => 'attachment', 'post_status' => 'inherit' ) );
query_posts( $args );
}
}
?>
<section id="primary" class="site-content">
<div id="content" role="main">
<?php if ( $use_mla_gallery ) : ?>
<?php get_template_part( 'content', 'mla-gallery' ); ?>
<?php elseif ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php
if ( is_day() ) :
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) :
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
elseif ( is_year() ) :
printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
elseif ( $is_media_archive ) :
_e( 'Media Archives', 'mla-child-theme' );
else :
_e( 'Archives', 'twentytwelve' );
endif;
?></h1>
</header><!-- .archive-header -->
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
if ( $is_media_archive ) {
get_template_part( 'content', 'media' );
} else {
get_template_part( 'content', get_post_format() );
}
endwhile;
twentytwelve_content_nav( 'nav-below' );
?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>