Custom Post Type and anchor points
-
I have a custom post type that posts the titles of all the posts on the top of the page followed by the actual posts going down the page. How would I add a way to link the titles at the top of the page to the actual post farther down the page. Here is the markup I currently have.
<div id=”top”></div>
<!– Row for main content area –>
<div id=”content” class=”row services”>
<div id=”main” class=”eleven columns centered” role=”main”>
<div class=”post-box”>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, ‘page’ ); ?>
<ol class=”serviceTitles”>
<?php
$args = array(
‘post_type’ => ‘service’
);
$services = new WP_Query( $args );
if( $services->have_posts() ) {
while( $services->have_posts() ) {
$services->the_post();
?>- <h4><?php the_title() ?></h4>
<?php
}
}
else {
echo ‘Oh ohm no services titles!’;
}?>
<hr><?php
/**
* Seriously I never used comments on a page, what for?
*/
//comments_template( ”, true );
?><?php endwhile; // end of the loop. ?>
</div>
</div><!– /#main –>
<div class=”row”>
<div class=”eleven columns centered”>-
<?php
- <h1><?php the_title() ?></h1>
$args = array(
‘post_type’ => ‘service’ );
$services = new WP_Query( $args );
if( $services->have_posts() ) {
while( $services->have_posts() ) {
$services->the_post();
?>
<div class=”row”>
<div class=”six columns”></div>
<div class=”two columns offset-by-four back”>
<div id=”backtotop”>Back To Top</div>
</div>
</div>
<div class=”row”>
<div class=”twelve columns”>
<div class=’content’>
<?php the_content() ?>
<hr>
</div>
</div>
</div>
<?php
}
}
else {
echo ‘Oh ohm no services!’;
}?>
</div>
</div>
</div><!– End Content row –>
- The topic ‘Custom Post Type and anchor points’ is closed to new replies.