-
lynnedrakeParticipant
Thanks again for the great theme. Is there a way to click on an image in the slider and have it go directly to the enlarged imaged (with the darkened diagonal stripes) and skip going to the post completely? Many many thanks!
Daniel TaraKeymasterOpen slider.php and replace this code:
<a href="<?php the_permalink() ? rel="nofollow">" rel="bookmark" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail( 'slider-thumb' ); ?> </a>
with this:
<a href="<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); echo $image[0] ? rel="nofollow">" rel="bookmark" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail( 'slider-thumb' ); ?> </a>
lynnedrakeParticipantThanks so much Daniel, — but I don’t have a slider.php in the — do you mean loop-slider.php? My code is different (but similar!) to what you show above — Thank you for your help!
<div id="post-” style=”background:url() center no-repeat”>
<a class="overlay" href="” rel=”bookmark”>
<a href="” title=”” rel=”bookmark”>
- This reply was modified 12 years, 5 months ago by lynnedrake.
- This reply was modified 12 years, 5 months ago by lynnedrake.
lynnedrakeParticipantSorry, I’m having trouble copying the code in — is there a special way I should copy it in? It isn’t displaying correctly from what I copied. Thank you!
Daniel TaraKeymasterI’m sorry, the line you need to replace is this:
<a class="overlay" href="<?php the_permalink(); ?>" rel="bookmark"></a>
with this:
<a class="overlay" href="<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); echo $image[0]; ?>" rel="bookmark"></a>
lynnedrakeParticipantOk — switched browsers — here is the way my code is in loop-slider.php: (a little different but very similar) Thanks Daniel!
<div id="post-” style=”background:url() center no-repeat”>
<a class="overlay" href="” rel=”bookmark”>
<a href="” title=”” rel=”bookmark”>
lynnedrakeParticipantYes! It works! Thank you so much! Do you have a place for (modest, I’m afraid) donations from thankful users of your theme?
lynnedrakeParticipantIs there a way to go to the enlarged image with the black diagonal lines and the small “x” box in the corner like the demo?
lynnedrakeParticipantSorry – one more problem. I had the last image of my last post going to a contact form page, and now it doesn’t. Can I make that one image still go to a post?
Daniel TaraKeymasterTo make the image open in a lightbox replace in the code above
rel="bookmark"
withrel="colorbox"
.To exempt the contact form from this, find the post or page’s ID and add an exception to it like this:
<a class="overlay" href="<?php if( xxx != get_the_ID() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); echo $image[0]; } else { the_permalink(); } ?>" rel="colorbox"></a>
lynnedrakeParticipantIn the loop-slider.php there are no references to post ID’s – it looks like there are global changes there. How can I find the individual post ID from there? And what would I replace with this new exception? I can get to the content-audio.php for that post (it’s the only one saved that way) – but that seems wrong since it worked before I made the changes to the loop-slider.php? Thanks so very much for your help Daniel!!!
Daniel TaraKeymasterYou find the post ID in the admin when editing the post, the URL looks like this:
/post.php?post=xxx&action=edit
lynnedrakeParticipantThanks Daniel, I replaced “bookmark” with “colorbox” in the loop-slider but no change – I saw another “bookmark” a little further down, tried that, no change. (tried them both, and then swapped them, no change) I also tried changing “bookmark” to “colorbox” in two places in the loop.php, but I haven’t been able to get to the lightbox yet.
Sorry for my basic question about the post ID – I have that now! But before I insert the code in, I want to be sure I’m putting it in the right spot. In the loop-slider.php, where do I insert that code in? Right after the code we added above? (Sorry, I’m new to this) Thank you Daniel!!
You must be logged in to reply to this topic.