Tips and Tricks HQ Support Portal › Forums › WP Photo Seller › How to move the View Gallery Button to top of Details Page ?
- This topic has 3 replies, 2 voices, and was last updated 9 years, 1 month ago by
Peter.
-
AuthorPosts
-
October 14, 2016 at 10:32 am #13773
WebInc
MemberWe wish to have the ‘View Gallery’ button on the details page at the top above the image. (as well as on the bottom).
We could create a hook box or something to put it in (if that’s the best way) but what is the code we should use to do that?
Or is there a known way to make it appear there. I couldn’t find anything in the forum, so forgive me if this has already been answered.
Thank you
October 15, 2016 at 11:21 am #74394WebInc
MemberI know we probably shouldn’t, but we added code to your photo-details-template.php and photo-details-template-new.php pages like this, to add a ‘Back to Gallery’ link at the top of the Photo Details page.
I know it is liable to be overwritten when the plugin is updated, so would be grateful if possible, for you to include the option of a ‘Back to Gallery’ link at the top of Photo Details with future updates.
Thank you
`<?php
echo '<a href="'.$gallery_page.'gallery'.$cached_current_gallery_id.'">«Back to Gallery</a>';
?>`
`
October 17, 2016 at 11:29 am #74395Peter
MemberI think the best way to do this would be to add a wordpress filter in the code which renders the photo details page. You would then use that filter by putting code in your theme’s functions.php file and hence you will never need to modify the photo seller core code.
I will look into this and let you know later in the week.
October 21, 2016 at 2:01 am #74396Peter
MemberAfter thinking about this, a better way to solve your issue without hacking the plugin is to add some code to your theme’s functions.php file which will use javascript to add a button after page is loaded.
Here’s an example:
add_action( 'wp_footer', 'footer_tasks' );
function footer_tasks()
{
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var cloned = $('.wps_photo_details_continue_shopping_section').clone().addClass('continue_shopping_section_top');
$('.wps-image-details').prepend(cloned);
$('.continue_shopping_section_top').wrap('<div class="continue-shopping-top"></div>');
});
</script>
<?php
} -
AuthorPosts
- You must be logged in to reply to this topic.