Skip to content

Commit

Permalink
Added support for additional navigation classes in the attachment page
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Mar 28, 2013
1 parent e8840e1 commit 64d3035
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MeetGavernWP/css/stuff.css
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,18 @@ i.icon-fullscreen { background-position: -456px -144px; }
margin-left: 140px;
}

.attachment-page section.intro {
overflow: hidden;
}

.nav-prev {
float: left;
}

.nav-next {
float: right;
}

/* 7.14. Demo content
==================================== */
.gk-demo-content {
Expand Down
18 changes: 18 additions & 0 deletions MeetGavernWP/gavern/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ function gavern_post_aside_class($classes) {

add_filter('post_class', 'gavern_post_aside_class');

/**
*
* Function used in the attachment page image links
*
* @return the additional class in the links
*
**/

function gavern_img_link_class( $link )
{
$class = 'next_image_link' === current_filter() ? 'next' : 'prev';

return str_replace( '<a ', '<a class="btn-nav nav-'.$class.'"', $link );
}

add_filter( 'previous_image_link', 'gavern_img_link_class' );
add_filter( 'next_image_link', 'gavern_img_link_class' );

/**
*
* Function used as a die handler
Expand Down

0 comments on commit 64d3035

Please sign in to comment.