Support

Account

Home Forums General Issues Replace code with ACF to download PDF file

Solved

Replace code with ACF to download PDF file

  • Hi Advanced custom fields experts.

    I am trying to do something while I am not a coder and try to do something but …. as usual does not work. I have this code (which is an portfolio grid) and would like to link the titel which is placed (the permalink) instead to the article to a PDf file to download, a custom field created with ACF and is called “catalogo-pdf”. I have been trying to change various line in this code below but all with no effect. Now I am sure it could be easy but I just don’t see it. Who can send me ind e the right direction? Thanks.

    // Display the title
    									if ( 'false' != $title ) { ?>
    										<h2 class="portfolio-entry-title" <?php echo $heading_style; ?>>
    											<?php
    											// Link title to post
    											if ( 'post' == $title_link ) { ?>
    												<a href="<?php echo $post_permalink; ?>" title="<?php echo $post_title_esc; ?>" <?php echo $heading_style; ?>><?php echo $post_title; ?></a>
    											<?php }
    											// Link title to lightbox
    											elseif ( 'lightbox' == $title_link ) { ?>
    												<a href="<?php echo wp_get_attachment_url( get_post_thumbnail_id() ); ?>" title="<?php echo $post_title_esc; ?>" class="wpex-lightbox" <?php echo $heading_style; ?>><?php echo $post_title; ?></a>
    											<?php }
    											// Display title without link
    											else {
    												echo $post_title;
    											} ?>
    
  • Can you provide a bit more code than what you’ve pasted here? It’s difficult to tell what some of those variables are supposed to be returning. For example, the field you mention, catalogo-pdf, doesn’t appear anywhere in that code.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.