Support » Fixing WordPress » Week as a Post with 3 Posts [Post within a Post]

  • Resolved mcnamc2

    (@mcnamc2)


    I am working on a running website, which has one week and three workouts.

    Can I create a post for “Week 1” and include three posts associated with that Week 1?

    Post: Week 1
    No content. Other than maybe, “Stay warm out there!”

    Post 2: Day 1
    Associate with Week 1
    Has content

    Post 3: Day 2
    Associate with Week 1
    Has Content

    Post 4: Day 3
    Associate with Week 1

    I see a handful of plugins for posts within posts, but is a bit overwhelming. I want to keep it simple! Or if a Taxonomy approach is best, do let me know and point me to how to set it up.

    Thanks,
    Catharine

Viewing 15 replies - 16 through 30 (of 32 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    oooh, is it possible that was because I had functions.php in BOTH parent theme folder AND the child theme folder?

    No, that is allowed. Don’t copy the functions.php file from your parent theme over, create the file with a good text editor and copy the pastebin code into it.

    Here are some text editors that don’t mess with the formatting:
    free for Windows: Notepad++
    free for Mac: TextWrangler

    Interesting, that worked. I had been using Sublime Velocity all along.

    Thank you — I am going to play with the series posting set up right now and see how that works! 🙂

    So grateful for your help, I really really appreciate your guidance as I learn WordPress. I am loving its flexibility!

    Catharine

    Hi Keeslemeijer:

    I’ve been going through your steps, and I’m worried that I’m creating a LOT of pages.

    What I’ve done, if I understood your instructions correctly is:

    1. add the single-workout.php and updated template.php files to my child themes.
    2. Created a new page, “Series (test)”
    3. Created a new page, “Endurance (test)”
    4. Created a new page, “Endurance (test) Week 1”
    5. Created a new workout post,/strong>, “Day 1”

    I am missing some connections between Steps 4 & 5:
    I created a WORKOUT post, but I cannot find the Parent that I mean to assign it to.
    When do I use the workout posts that you created for me?

    here’s my site: http://www.cfote.com if you want to see how they are set up thus far.
    I am happy to share with you admin account if you want to take a look.

    Here’s the “Series Week 1 page:
    http://www.cfote.com/series-test/week-1-test/day-1-workout-page-test/

    I noticed the breadcrumb needs one more layer. Is this something I do in the template.php file?

    (There will be multiple series)

    I am concerned with the approach outlined above that I’m creating a lot of PAGES that will make for a very very long navigation menu? Or have I misinterpreted?

    Thanks!
    Catharine

    Moderator keesiemeijer

    (@keesiemeijer)

    I’ve been going through your steps, and I’m worried that I’m creating a LOT of pages.

    Well yes, every series is a page, every week is a page and every day is a page. This is to get pretty urls (workout/serie/week-1/day-1) and later we can query the weeks of a series or days of a particular week from a series etc..

    I am concerned with the approach outlined above that I’m creating a lot of PAGES that will make for a very very long navigation menu? Or have I misinterpreted?

    That depends what you put in the menu, only series or series and their weeks, or series with weeks and days. Right now all pages get automatically added to the “Header Menu”. Look under wp-admin > Appearance > Menus to create your own menus.
    http://codex.wordpress.org/WordPress_Menu_User_Guide

    Try creating the menu you want, and for the “series” menu item add a “Custom Links” menu item with the url “http://www.cfote.com/workout/” and label “series” to the “Header Menu.

    You don’t have to create a page called series

    1. Create a new (top level)(series) workout page, “Endurance”
    2. Create a new workout page, “Week 1” with parent “Endurance”
    3. Create a new workout post, “Day 1” with parent “Week 1”

    Endurance
    – week 1
    — day 1

    Add the endurance page to the “series” menu item in your menu.

    I noticed the breadcrumb needs one more layer. Is this something I do in the template.php file?

    I will look into it.

    Hi! I think I found the issue:

    When I go to the new workout post, the only parents available are the other workout posts that I created.

    I deleted the Series page. (so that should resolve the breadcrumb issue)

    I created a Page: Endurance
    I created another Page: Week One. Was successful in setting Endurance as the parent.
    I created a Workout Post, Day 1.
    Parents available were NOT pages. But other workout posts that I created as test content.

    Know why that might be? Is there something I need to inspect in the code, the single-workout.php?

    Working on the menu steps right now.

    Catharine

    (FWIW, I do not have “Workout Pages” if that’s a page type that you created. Just Workouts an >Add Posts are available options)

    Moderator keesiemeijer

    (@keesiemeijer)

    Did you create the pages with the “workout” custom post type: http://i45.tinypic.com/4jqt1h.jpg

    Got the menus working! Thanks.

    AH! I got confused by the use of “Pages” and “posts” and created my pages OUTSIDE of the Workout Custom Post Type.

    Starting that again and trying my “Pages” from there. Hang tight. 🙂

    That worked. Thanks!

    Have successfully used Query Wrangler to run queries off of selected categories for the different series to post on the Homepage widgets. It’s really coming together, nearly complete. I am excited!

    I’m trying to figure out from the homepage, how to allow for a site visitor to select the “category” of the workout they’d like to run from a drop-down list, and then the widgets will refresh to show the query. If you know of any forum posters who are savvy in this area, please do pass along!

    http://wordpress.org/support/topic/homepage-query-based-on-users-category-selection?replies=1

    Moderator keesiemeijer

    (@keesiemeijer)

    I never used that plugin before. Where can I see one of the widgets.

    Now you have these links:

    http://www.cfote.com/workout/
    http://www.cfote.com/workout/endurance/
    http://www.cfote.com/workout/endurance/week-1/
    http://www.cfote.com/workout/endurance/week-1/day-1/

    What would you like to show on these pages?

    As of now /workout/ shows all pages. To show only “series” pages (endurence etc..) add this to your child theme’s functions.php:

    function my_post_queries( $query ) {
      // not an admin page and is the main query
      if (!is_admin() && $query->is_main_query()){
        if(is_post_type_archive( 'workout' )){
          $query->set('post_parent', 0);
        }
      }
    }
    add_action( 'pre_get_posts', 'my_post_queries' );

    Did you connect the pages with the plugin?

    This is the plugin:
    http://wordpress.org/extend/plugins/query-wrangler/

    I got the plugin to pull in pages based on filters: category [category name] and Page Name (Day 1)

    I used the QW Widget and put it on the homepage. Pretty slick. Now I need to do it x3, one for each day. And have the widget refresh based on the user’s selected category.

    I will duplicate the code you provided above to specify what displays on those pages:
    /workout — All Series
    /endurance/ All Weeks
    /endurance/week-1/ All Days
    /endurance/week-1/day-1/ The workout itself.

    The intent is for the user to not need to go to these pages, but as an archival record of past workouts that can be searchable.

    My goal is for the widgets that post that week’s workouts from the homepage based on the user’s selected workout “track.”

    Pretty cool right?!
    Catharine

    Moderator keesiemeijer

    (@keesiemeijer)

    Not sure I understand, I only see the “Archive” widget on the front page? How do the users select a workout “track”?

    I will check out the plugin.

    Sorry about that — that is strange you only see “Archive” . wonder why?!

    Do you not see this widget on the homepage? (which I do not have background on yet, whoops)

    http://cl.ly/image/1l1w3P220e3N

    Linked here my planned UX for the homepage:
    http://cl.ly/image/0B3e1L1A1A2F

    Hopefully that’ll help you understand. I got the widgets to work appropriately.

    Now I need to figure out a way to allow users to select their “category” and have the widgets update the query. …by javascript?

    Catharine

    Moderator keesiemeijer

    (@keesiemeijer)

    Is “marathon” a category or a “serie” in the workout custom post type?

    Now I need to figure out a way to allow users to select their “category” and have the widgets update the query. …by javascript?

    Do you mean update without a new page load? I don’t think you can do that in combination with query-wrangler. Maybe with javascript and ajax: https://codex.wordpress.org/AJAX

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘Week as a Post with 3 Posts [Post within a Post]’ is closed to new replies.