Creating link from one to post to the other.
-
Hello,
I don’t know how to create a link from one post to another. Just to be clear, I know how to do simple link in HTML and even PHP, but my example seems too much for me.
Link for the live website: link
On the bottom left corner you’ll see a “Phoenix Pool & Spas” name on the blue background and I want this name linked to the “Phoenix Pool & Spas” post. For the moment it is linked to the “5474 Coach Ln” post, besically doing the same as “More details” button. I don’t want permanent link, cause it’s easy knowing the post ID, I want it to be dynamic. I hope it is possible.
Here’s the piece of code for this link:
<div class="detail"> <h5 class="price"> <a href="<?php the_permalink(); ?>"> <?php $post_meta_data = get_post_custom($post->ID); if( !empty($post_meta_data['REAL_HOMES_property_contractor'][0]) ) { $prop_contractor = $post_meta_data['REAL_HOMES_property_contractor'][0]; echo '<span>'; echo esc_html( $prop_contractor ); echo '</span>'; } ?></a> </h5> <p><?php framework_excerpt(12); ?></p> <a class="more-details" href="<?php the_permalink() ?>"><?php _e('More Details ','framework'); ?><i class="fa fa-caret-right"></i></a> </div>
I hope to learn something here as well. Thanks for all the inputs.
- The topic ‘Creating link from one to post to the other.’ is closed to new replies.