WordPress.org

Ready to get started?Download WordPress

Forums

MP3-jPlayer
Page Template getting category not working. (2 posts)

  1. scamartist26
    Member
    Posted 2 years ago #

    I am hoping someone can help me fix this problem. Here is how I am wishing to display music.

    1. Create post with shortcode and give category of "Jams"
    2. Have page template that calls category "Jams"

    Now, when I use the link to the get the category of "Jams" this works just fine. The problem is I don't want the "/category/jams" in the url. Also, the current_page_item CSS class does not work for my top level menu.

    This is where the problem is. When I create a page template with a loop that pulls in only my category, the player goes all wonky, and does not display any links, just the player and the title of the post.

    Here is my code for the template page:
    `<?php
    /*
    Template Name: JamsPage
    */
    get_header(); ?>

    <?php $my_query = new WP_Query('category_name=jams');
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    <?php the_content();
    endwhile;

    get_footer(); ?>`

    link to the PAGE display:
    http://theywalkonwater.com/wordpress/jams/

    link to ARCHIVE display:
    http://theywalkonwater.com/wordpress/category/jams/

    Am I missing something? or is this a bug?

  2. scamartist26
    Member
    Posted 2 years ago #

    edit to code including backticks OOPS (read more better Nate)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic