Need help using WordPress like a CMS
-
Brief-
I am trying to use WordPress as a CMS to display my portfolio work.As a reference, I am trying to implement functionality similar to this site. I have added Custom Fields to store images in and here is the Loop that I am using on my Static Home page Template.<?php if (have_posts()) : ?> <?php query_posts('category_name=portfolio&showposts=4'); ?> <?php while (have_posts()) : the_post(); ?> <div class="recent_item_home" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <a href="#<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php echo '<img class="recent_item_home_thumb" src="'.get_post_meta($post->ID, 'thumbnail', TRUE).'" />';?> </a> </div> <?php endwhile; ?> <?php else : ?> <?php endif; ?>The main issue I am having is creating a relative link to the portfolio category with an anchor tag pointing to the post. I am currently using the function the_permalink() for the URL but this is not what I want. When I use the function the_permalink() to build the link I get an absolute path and when I click the link it takes me to a single post post page.
What I would like to happen:
- A front page that pulls 4 of the latest posts from the portfolio category – just to display a thumbnail image and maybe a title. almost there.
-
Needs to have the link created in The Loop dynamically but unsure how to implement.
desired link format- category/portfolio/#post_ID
Any help and or comments appreciated. Also, If there is a better way to implement a portfolio using WordPress please let me know.
The topic ‘Need help using WordPress like a CMS’ is closed to new replies.