Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2015-05-26 06:16:28

fabian.trees
Member
Registered: 2012-09-26
Posts: 34

Custom Field in WP

Hello folks,

I am migrating my whole page from ce2 to ce4... what a big step! I had in ce2 a link (with a custom field called galerie) witch allowed by clicking on the main image in a single post to jump to a given side... it was implemented like that in the-loop:

<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php echo get_post_meta($post->ID, 'galerie', true) ?>" title="<?php the_title_attribute(); ?>" class="post-image-link">
<?php the_post_thumbnail( 'large', array('class' => 'post-image') ); ?>
</a>
<?php endif; ?>

Now in CE4 things are changed (and much more sophisticated and also complicated). Have anyone of you in the net an idea, where I have to put now the code to obtain a similar result (link to a given gallery)?

Thanks in advance
Fabian
www.imagepower.ch

Offline

#2 2015-06-11 05:32:37

fabian.trees
Member
Registered: 2012-09-26
Posts: 34

Re: Custom Field in WP

I found a solution and post it her for your information:
Search the DIV of post-featured-image and replace the code with this:

<div id="post-<?php the_ID(); ?>-featured-image" class="post-featured-image collapse_top" style="max-width:<?php echo $imgwidth; ?>px;">
    <a href="<?php echo get_post_meta($post->ID, 'galerie', true) ?>" title="<?php the_title_attribute(); ?>" class="post-image-link">     
        <?php the_post_thumbnail( 'large', array('class' => 'size-large post_thumbnail ' . of_get_option('hd_image_class'), 'width' => $imgwidth, 'height' => $imgheight, 'data-full-rendition' => $img_full[0]) ); ?> 

    </a>  

</div><!-- .post-featured-image -->

So you can use a custom field to submit the URL of a gallery!
Fabian

Offline

Board footer

Powered by FluxBB