WordPress.org

Ready to get started?Download WordPress

Forums

Mantra
[resolved] Page template-how to use? (10 posts)

  1. jtlepage
    Member
    Posted 1 year ago #

    I'm new to WordPress. Mantra has a page template choice "Page with Intro" which I think is set up to do just what I want but I don't know how to use it. Do I have to edit the *.php?
    The file says:

    // replace $slub with get_the_title() in the line below if you want to get posts based
    // on category name instead of slug ?>
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name='.slug.' &post_status=publish,...

    I want to show all posts for a certain category 'choir' on the page with static information at the top, everything I've tried yields all posts, not just the cat=choir posts. Can you tell me how to use this template? And, if I need to edit it what should it say? THX! http://www.hanfordmusic.org/wp/?page_id=174

    http://wordpress.org/extend/themes/mantra/

  2. jtlepage
    Member
    Posted 1 year ago #

    I was able to resolve this issue myself. I was making it more complicated than necessary. Great theme!

  3. Zambronix
    Member
    Posted 1 year ago #

    How did you resolve it. I've been stuck for 2 days now.

  4. jtlepage
    Member
    Posted 1 year ago #

    Go to Appearance/editor and edit that file. Here's a snippet of the code, change that last $slug to
    the category name you are trying to load on your page. (note, another mantra user said she got hers to work without editing the php, but I haven't been able to.)

    // replace $slub with get_the_title() in the line below if you want to get posts based
    // on category name instead of slug ?>
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name='.$slug.

    You'll want to use a child theme or backup your edited file so that you don't lose that change with theme updates.

  5. jtlepage
    Member
    Posted 1 year ago #

    whoops, I mean edit the page-with-intro.php file.

  6. CryoutCreations
    Member
    Theme Author

    Posted 1 year ago #

    You don't have to edit any files. Just create a page that has the same name as the category and that category's posts will be loaded into the page. Give it a try ;)

  7. jtlepage
    Member
    Posted 1 year ago #

    That's how I thought it was supposed to work but I couldn't get it to work like that. Do you think it makes a difference if I created my site on a WAMP server and imported it? Do you have to create the category before the page? There must be some nuance that I didn't get quite right. I'm struggling with it on another WAMP site now.
    http://www.hanfordmusic.org/wp/?page_id=349

  8. jtlepage
    Member
    Posted 1 year ago #

    In case anyone is interested, for me at least, I had to change the permalinks settings from the default to the month and name (or any choice w/ name) setting. Then the page-with-intro template worked like a charm!

  9. Zandah
    Member
    Posted 1 year ago #

    I made sure my slugs were the same, but only the newest post is visible. Can't I link a menu item to the category page url?

  10. jtlepage
    Member
    Posted 1 year ago #

    Zandah, you certainly can make a menu item a category. Do that under "Appearance/menus"

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags