code clean-up: querying a specific post
-
I was wondering if someone could be so kind as to clean this up for me so that I don’t have to keep on defining the post, but instead define it once at the start and just use the normal title, content and featured image tags etc.
Thanks heaps.
<h2><?php $post_id = of_get_option('tabber_post1', 'no entry' ); $queried_post = get_post($post_id); echo $queried_post->post_title; ?></h2> <h1><a href="<?php echo get_permalink($post_id = of_get_option('tabber_post1', 'no entry' )); ?>" rel="bookmark"><?php $post_id = of_get_option('tabber_post1', 'no entry' ); $queried_post = get_post($post_id); echo $queried_post->post_title; ?></a></h1> <?php $post_id = of_get_option('tabber_post1', 'no entry' ); $queried_post = get_post($post_id); $content = $queried_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘code clean-up: querying a specific post’ is closed to new replies.