ThemeShaper Forums » Thematic

[closed]

Posts inside the Pages and subpages

(56 posts)
  • Started 5 years ago by oscar
  • Latest reply from amoore
  • This topic is resolved
  1. As for the nonce location: Is either of these better or does it matter?

    echo'<select name="'.$meta_box_name.'_noncename" id="'.$meta_box_name.'_noncename" >';

    or

    echo'<input type="hidden" name="'.$meta_box_name.'_noncename" id="'.$meta_box_name.'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
    Posted 5 years ago #
  2. Gene - Thank you thank you so much for your help here with the category query page template. I've been going through all kinds of possible solutions on the WP forums trying to find one I understand and yours is great. I put your original piece of code into my functions.php

    function child_theme_custom_query() {
    
        	if (is_page('48')) { // change '48' to the id # of your page
    
    	$limit = get_option('posts_per_page');
        	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
            //change '4' to you category id # and change the value of $limit to the # of posts you want displayed per page
        	query_posts('cat=4' . '&showposts=' . $limit=2 . '&paged=' . $paged );
    
        	$wp_query->is_archive = true; $wp_query->is_home = false;
        	}
    }
    
    add_action('thematic_above_indexloop', 'child_theme_custom_query');

    The one problem is that the page that I've applied this category query to comes up with only excerpts of the posts rather than fully displayed posts. Here's the page: http://garycrofts.com/test/mynews/. Do you have any suggestions for how to display the full post?

    Thank you for all the help you've already given,
    Gary

    Posted 5 years ago #
  3. Gary- try:

    function child_archive_content($content) {
    	if (is_archive()) $content ="excerpt";
    	return $content;
    }
    add_filter('thematic_content', 'child_archive_content');

    -Gene

    Posted 5 years ago #
  4. Chris-

    I finally came back to "my different approach" and got it sorted out. Flipping multidimensional arrays always get the best of me. I may eventually get around to looking at a more straight forward and compartmental way similar to Hybrid's meta-box.php.

    Thanks for all your help with this-
    Gene

    Posted 5 years ago #
  5. Hi Gene,

    sorry, but my last days were too fast-paced to get my brain free to solve this multi-dimensional array problem.

    I already thought about integrating this meta-box functionality. Currently I'm looking for the best way to outsource a couple of things into external modules. These could be loaded into the child themes as needed. This could be controlled using the child theme's functions.php or using the upcoming configuration / management plugin.

    Chris

    Posted 5 years ago #
  6. @Gary- I am am a total fool for not reading properly... change "excerpt" to "full" in my code.

    @Chris - No worries. I like the idea of the plugin approach. It'd be easier to keep the code up to date that way.

    Posted 5 years ago #
  7. Gene - oh no problem at all :) I appreciate this so much, I'll give it a try. This goes in my functions.php as well, yes?

    Posted 5 years ago #
  8. Gene - stuck that in my functions.php and it's working perfectly.

    Posted 5 years ago #
  9. Promising improvements on this method of meta boxing here:

    http://wefunction.com/2009/10/revisited-creating-custom-write-panels-in-wordpress/

    Posted 5 years ago #
  10. A heads up for anyone using a custom query loop as described in this thread. It my be necessary to reset the query with <?php wp_reset_query() ?> after the loop is complete in order to make condtional tags work properly or to pull custom fields from the original page's post meta.

    Posted 5 years ago #
  11. lqunta
    Member

    Greetings Guys
    @Chris, @Gene

    I've been going through your code suggestions above, and, seem to be lost at the point where Gene is talking about multi-dimensional arrays. Being quite 'green' in all this, pardon me to ask,
    -Which is the code that works perfectly [i.e., where one can edit from within WPadmin]?
    -For each page, where one wants to display posts from a corresponding [similarly named] category...should one have to create the .php page template?
    -Is it possible to have the generated pages in the following manner : Thumbnail[floated left], The Content[i.e. Post Title, Post Category, Post Excerpt] floated right]?

    Thanks all for the great work you're doing in the forums [in just a matter of hours, I've managed to move ahead by leaps and bounds].

    Cheers
    LQunta

    Posted 5 years ago #
  12. lqunta-

    1. All of the code up to and including Chris's works great. After that I was having some learning curve issues with what I was trying. I've gotten it sorted out now. I may return to this discussion with my solutions sometime if there is continued interest.

    2. To use those code examples all pages that you want to aggregate posts need to be assigned the one custom template created in the example above.

    3. Yes. Very possible. As for the thumbnail bit I'd suggest maybe waiting for WP 2.9 soon to be beta.

    Instead of the usual custom field approach to thumbnail images 2.9 will introduce the template tag the_post_image() and set the image will be done from the admin.

    - Gene

    Posted 5 years ago #
  13. lqunta
    Member

    Well, Gene,

    Thanks for your prompt response to my query and clarifying what is possible, and what is not. Pardon me if I sound rather 'green', but, how can I incorporate the desired layout [i.e. Thumbnail[floated left] - we can ignore this for now, The Content[i.e. Post Title, Post Category, Post Excerpt] floated right]? I have my desired layout ready - for the post excerpts] as thus:


    <div id="post_list">
    <!-- The thumblail div would be here -->
    <div id="post_content">
    <h2>Post Title Here</h2>
    <span>Post Category</span>
    <p>Post Excerpt</p>
    </div>
    </div>

    I'll have to consent that my knowledge in coding [php] is limited at best. Yet again, pardon me for sounding rather 'daft'

    LQunta
    [learning by doing]

    Posted 5 years ago #
  14. lqunta-

    No worries. We're all learning around here. I'll work on this and get back with some code later on today. I'll try and take into to account the setup you described in another thread.

    - Categories [e.g. My Articles], which have Sub-Categories [e.g. Fictional Stories, Poems, Tips]
    - As such, I would like, when one clicks on a category, e.g. Fictional Stories, he/ she should, first of all, read about the category [category description], then, a listing of the current category's content as mentioned above, limited to x number of articles

    -Gene

    Posted 5 years ago #
  15. lqunta
    Member

    Hi Gene,

    Thanks for proposing to have a go at the code. Will surely want to see how you'll implement this.

    Cheers
    LQunta

    [bn offline for some days]

    Posted 5 years ago #
  16. Hi Chris & em hr,

    Thanks for the solution of the new meta-boxes on the first page of this thread.
    It's working for me but when the posts output to my specific pages they are excerpted i.e.truncated.

    How do I change the code to allow the full post to come through for the page loop?

    I am guessing its this bit that I need to change not the laying out the custom fields.

    function child_theme_custom_query() {
    global $post;

    if (get_post_meta($post->ID, 'page_query_posts', true)) {

    $limit = get_post_meta($post->ID, 'limit', true);
    $category = get_post_meta($post->ID, 'category',true);
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

    query_posts('cat=' .$category. '&showposts=' . $limit . '&paged=' . $paged );

    $wp_query->is_archive = true; $wp_query->is_home = false;
    }
    }

    add_action('thematic_above_indexloop', 'child_theme_custom_query');

    Thanks in advance

    D

    Posted 4 years ago #
  17. @ lqunta -

    On review, I think my answers to your questions in the other thread may serve you better than using this method.

    @ dylancoyne-

    Since $wp_query->is_archive = true the function thematic_content() inside thematic_index_loop outputs an excerpt. If you want the full content then filter thematic_content() like in my response to Gary above.

    -Gene

    Posted 4 years ago #
  18. Gene -

    Thanks, that works for me now. I tried that filter earlier but I didn't see the post about making excerpt 'full' i.e. declaring $content ="full";

    Posted 4 years ago #
  19. Hi em hr
    Thanks for this great solution.
    I am tryng to insert the page content before the category loop, to use that as introduction or a customizable intro area
    Can you give me a clue on how to edit it to display the page content above the category loop?

    thanks a lot!

    Posted 4 years ago #
  20. I heart this discussion...

    @ saski Sorry, I've been really busy. I'll be back to this soon.

    Posted 4 years ago #
  21. trexr
    Member

    @em hr

    using your first response in this thread, for some reason inserted images do not appear in the page even though they appear in standard loop posting. Did any one else have this problem?
    any suggestions?

    Thanks so much!

    Posted 4 years ago #
  22. Not sure if any of you are still workin on this thread since its been a few months now. But yeah, I got the same missing photo thing happening. Everything works from Chris' code. Took me a couple of hours to follow this whole conversation.

    And another question, how do I get the new page posts to NOT appear on the main page? The posts seem to double up, one on the main blog page and then the same one is on the new "Category Query Page". Other than that everything works hunkydory. Setting up the blog posts to the new CATEGORY works fine.

    Thanks if any of you get to helping me with this.

    Posted 4 years ago #
  23. H trexr & raul,

    About the missing images, you need to filter thematic_content so that it shows full posts not excerpts for archives. Look back to the part of this conversation with Gary and try this code.

    function child_archive_content($content) {
    	if (is_archive()) $content ="full";
    	return $content;
    }
    add_filter('thematic_content', 'child_archive_content');

    -Gene

    Posted 4 years ago #
  24. Mickstah
    Member

    Sorry to bump an old thread guys but this is an excellent one!

    I love thematic however I've always had trouble showing a single category of posts on a page. The Custom Fields solution that Chris provided is brilliant however I'm having trouble getting it to filter the categories.

    I can apply the template and get the custom fields showing without any issue, but when I input the category id (in this case: 3) I still get the other category posts showing. I have permalinks active so I've tried various combinations of slugs, page IDs and even post IDs but still no change.

    Please note I am using Wordpress 3 - is it possible that this is causing the problem? Is it possible that Wordpress 3 has superseded this solution and I wasn't aware of it?

    Posted 4 years ago #
  25. Mickstah
    Member

    My apologies, disregard the above, turns out I had set my Reading Settings post page to the same page I was attempting to apply the template to. Of course the Reading Settings were overriding the custom fields thus returning all my posts instead of the select category.

    Let this be a simple lesson to others.

    Thank you again for this code, it works perfectly when you don't have a monkey like me operating it!

    Posted 4 years ago #
  26. amoore
    Member

    Thanks for this great (even when dated) thread!

    Did Saski's question get answered somewhere? I've got the rest working but would also love this answer:

    "I am tryng to insert the page content before the category loop, to use that as introduction or a customizable intro area Can you give me a clue on how to edit it to display the page content above the category loop?"

    Thanks!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.