Custom field “file” stopped working
-
I have a pod for downloadable resources with CFs file, authors and language. There are no single page for this pod, only the given list page. If you click on the title the downloadable pdf would load in a new tab.
This behaviour stopped working. The loop does not generate download path for the pdf.
What suspicious is that my text editor colors the$post->file
differently than$post->authors
or$post->language
.Here is my loop item:
<article class="sza_loop-item"> <div class="sza_icon"> <a href="<?php echo esc_url( $file ); ?>" target="_blank"><img src="/wp-content/uploads/2020/03/sza_pdf.svg"></a> </div> <div class="sza_content"> <?php if ( $post->authors ) { echo __( 'Authors: ', 'rogerstheme' ) . esc_html( $post->authors ) . '<br>'; } ?> <span class="sza_post-title"><?php echo '<a href="' . esc_url( $post->file ) . '"'; ?> target="_blank"><?php the_title() ?></a></span><span class="sza_lang-icon"><img height="16px" width="16px" src=<?php echo '"/wp-content/themes/rogerstheme/flags/' . esc_html( $post->language ) . '.svg"'; ?> alt=""></span><br><?php echo get_the_date( 'Y' ); ?> |<?php echo $output_tags; ?> </div> </article>
Questions:
1. Is it posible that the$post->file
is a system “variable” and I cannot use it for custom field name?
2. If I rename it to dfile then will the CF values remain intact?Best regards,
PeterThe page I need help with: [log in to see the link]
- The topic ‘Custom field “file” stopped working’ is closed to new replies.