Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--Custom post default -->
- <?php $your_variable= get_post_meta($post->ID, 'your_custom_field_id', true); ?>
- <!-- use -->
- <?php echo $your_variable; ?>
- <!-- Custom post if exists -->
- <?php if($your_variable) : ?>
- <a href="<?php echo $your_variable; ?>" class="job_pdf">Download Instructions</a>
- <?php endif; ?>
- <!-- Custom post dynamic -->
- <?php if ( $your_variable ) : ?>
- <a href="<?php echo $your_variable; ?>" class="job_pdf">Download Instructions</a>
- <?php else : ?>
- <p style="float:right">no job instructions available</p>
- <?php endif; ?>
- <!-- use Custom Field in idex.php -->
- <div class="slider">
- <?php
- // Determine context
- $page_id = ( 'page' == get_option( 'show_on_front' ) ? get_option( 'page_for_posts' ) : get_the_ID );
- // Echo post meta for $page_id
- $your_variable = get_post_meta($page_id, 'your_variable', true);
- $your_variable = get_post_meta($page_id, 'your_variable', true);
- ?>
- <h2><?php echo $your_variable; ?></h2>
- <h3><?php echo $your_variable; ?></h3>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement