Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Posts on a page. « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Posts on a page.

(7 posts)
  • Started 4 years ago by driftwood
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. driftwood
    Member

    Hey Folks I have a page called Journal that I would like to filter all my posts from a specific post category.

    I created a function but am not sure how to do it. I tried get_post etc but just does not work. Any help?

    function JournalPage() {

    if(is_page("Journal")) {

    }

    }
    add_filter('the_content', 'JournalPage');

    Posted 4 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Jonny Janiero

    Member

    if its a page, you need to use a template. set the page template in wp admin.
    thematic comes boxed with a 'blog template' you just need to ammend that to select the query you require (the category).
    Below is the code that makes up the blog template

    <?php
    /**
     * Template Name: Blog
     *
     * This template allows you to display the latest posts on any page of the site.
     *
     */
    
        // calling the header.php
        get_header();
    
        // action hook for placing content above #container
        thematic_abovecontainer();
    
    ?>
    
    		<div id="container">
    
    			<?php thematic_abovecontent();
    
    			echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n" );
    
    			$wp_query = new WP_Query();
    			$wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged ) );
    			$more = 0;
    			?>
    
    				<?php 
    
                	// create the navigation above the content
                	thematic_navigation_above();
    
                	// calling the widget area 'index-top'
                	get_sidebar('index-top');
    
                	// action hook for placing content above the index loop
                	thematic_above_indexloop();
    
                	// action hook creating the index loop
                	thematic_indexloop();
    
                	// action hook for placing content below the index loop
                	thematic_below_indexloop();
    
                	// calling the widget area 'index-bottom'
                	get_sidebar('index-bottom');
    
                	// create the navigation below the content
                	thematic_navigation_below();
    
                	?>
    
    			</div><!-- #content -->
    
    			<?php thematic_belowcontent(); ?> 
    
    		</div><!-- #container -->
    
    <?php 
    
        // action hook for placing content below #container
        thematic_belowcontainer();
    
        // calling the standard sidebar
        thematic_sidebar();
    
        // calling footer.php
        get_footer();
    
    ?>

    in this particular section above

    $wp_query = new WP_Query();
    			$wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged ) );
    			$more = 0;
    			?>

    you need to add to the query array, the category you want displayed.
    http://codex.wordpress.org/Function_Reference/query_posts#Category_Parameters

    hope this helps

    Posted 4 years ago #
  3. driftwood
    Member

    Thanks a bunch for your help!!!

    I got it half way working but must be doing something wrong.....

    <?php
    if (is_page(418)) {
    query_posts('category_name=journal' );
    }
    ?>

    I added the above.. and it does not filter. I get all the posts showing. Not sure I am putting this in the right place :(

    Posted 4 years ago #

  4. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Jonny Janiero

    Member

    if i understand correctly, you want a page that only shows posts from the category journal yeah?

    so use the template above. copy all of it into an empty php file and call the file
    template-page-journal.php

    change

    Template Name: Blog

    to

    Template Name: Journal

    set up a new page in wp-admin>pages, and select 'journal' it from page attributes.

    at the top of that template, change this section to reflect the added category..

    $wp_query = new WP_Query();
    			$wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'category_name' => 'journal', 'paged' => $paged ) );
    			$more = 0;

    this should work.
    you dont need those conditional, is page() if you are using the template.
    let me know how you get on

    hope this helps

    Posted 4 years ago #

  5. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Jonny Janiero

    Member

    oh, looking at that again, add the following line

    $paged = get_query_var( 'page' ) ? get_query_var( 'page' ) : 1;

    to the above query.
    so in full

    $paged = get_query_var( 'page' ) ? get_query_var( 'page' ) : 1;
    $wp_query = new WP_Query();
    			$wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'category_name' => 'journal', 'paged' => $paged ) );
    Posted 4 years ago #
  6. driftwood
    Member

    got it, and it works thanks!!!!

    Posted 4 years ago #

  7. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    helgatheviking

    Moderator

    excellent. don't forget to mark this thread as resolved.

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183