This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.photo-grid figcaption p { | |
display: table-cell; | |
font-size: 1.5em; | |
position: relative; | |
top: -40px; | |
width: 289px; | |
-webkit-transition: all 300ms ease-out; | |
-moz-transition: all 300ms ease-out; | |
transition: all 300ms ease-out; | |
vertical-align: middle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.photo-grid img { | |
display: block; | |
height: auto; | |
-webkit-transition: all 300ms; | |
-moz-transition: all 300ms; | |
transition: all 300ms; | |
max-width: 100%; | |
} | |
.photo-grid li:hover img { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.photo-grid li:hover figcaption { | |
opacity: 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.photo-grid { | |
margin: 1em auto; | |
max-width: 1106px; | |
text-align: center; | |
} | |
.photo-grid li { | |
border: 5px solid white; | |
display: inline-block; | |
margin: 1em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="photo-grid"> | |
<li> | |
<a href="http://www.flickr.com/photos/anirudhkoul/3536413126/"> | |
<figure> | |
<img src="images/arcdetriomphe_sm.png" height="180" width="320" alt="Arc de Triomphe"> | |
<figcaption><p>Arc de Triomphe</p></figcaption> | |
</figure> | |
</a> | |
</li> | |
<li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alphaindex_queries( $query ) { | |
/* Sort songs alpha */ | |
if ( ! is_admin() && ( is_post_type_archive( 'song' ) || is_tax( 'alpha' ) ) && $query->is_main_query() ) { | |
$query->set('orderby', 'name'); | |
$query->set('order', 'ASC'); | |
} | |
} | |
add_action( 'pre_get_posts', 'alphaindex_queries' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alphaindex_save_alpha( $post_id ) { | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) | |
return; | |
//only run for songs | |
$slug = 'song'; | |
$letter = ''; | |
// If this isn't a 'song' post, don't update it. | |
if ( isset( $_POST['post_type'] ) && ( $slug != $_POST['post_type'] ) ) | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alphaindex_alpha_tax() { | |
register_taxonomy( 'alpha',array ( | |
0 => 'song', | |
), | |
array( 'hierarchical' => false, | |
'label' => 'Alpha', | |
'show_ui' => false, | |
'query_var' => true, | |
'show_admin_column' => false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alphaindex_register_song() { | |
register_post_type('song', array( | |
'label' => 'Songs', | |
'menu_icon' => 'dashicons-format-audio', | |
'description' => '', | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'capability_type' => 'post', |