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
Filtering blog posts by category « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Filtering blog posts by category

(5 posts)
  • Started 4 years ago by tg_harris
  • Latest reply from tg_harris
  • This topic is not resolved

  1. 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
    tg_harris

    Member

    OK, seriously people, I need help.

    I know just enough PHP to get into trouble. My new commercial blog concept has a "news" page and a "product reviews" page, both based on the Thematic Blog page filtered by post category: "news" and "reviews" respectively.

    I created new News Page and Reviews Page templates like so:


    /**
    Template Name: News Page
    *
    * This template allows you to display the latest posts marked "news".
    *
    */
    ...
    ?>

    The reviews page is coded similarly. The first problem I found is that when I created these new template pages, naming them template-page-newspage.php and template-page-newspage.php, the new templates did not show up in the drop-down list of templates in the "Edit Page" page.

    Why are the new page templates not available?

    Next, on each of the new template pages I replaced the standard thematic_indexloop() call with a call to a custom loop with a category filter, e.g. news_page_indexloop()
    that calls this in functions.php


    // Create a new indexloop function for the News page template.
    function news_page_indexloop() {
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    <?php endwhile; else: endif; ?>
    <?php query_posts(‘category_name=news&post_status=publish,future’);?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h2>”><?php the_title(); ?></h2>
    <?php the_content(); ?>
    <?php endwhile; else: endif;
    }

    Which brings me to my second problem: they break my functions.php with an unexpected "=" in the query_posts line, so I have to comment them out. The code seems solid, where did I mess up?

    I can't seem to figure out why these problems are occuring. Can anyone help me figure this out?

    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
    tg_harris

    Member

    OK, so I think I don't need special functions based on what I learned here:

    http://forums.themeshaper.com/topic/using-template-page-blogphp-to-show-specific-categories

    But still, the new template pages are not recognized.

    What am I doing wrong?

    Posted 4 years ago #

  3. 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

    it should be working. the template is included (first level) of your child theme?
    in your first post, you miss the opening "<?php" tag in your example. check that.

    <?php
    /**
     * Template Name: My New Template
     */
    ?>

    otherwise, this should be working

    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
    tg_harris

    Member

    I tried a solution I found on Elite Freelancing.com: Activate a different theme--I used Thematic--then switch back to my new theme. Wordpress found the new page templates.

    My reviews page template is working exactly as I want it to. But my news page template still comes up as the old blog page, despite identical coding as the reviews page, save for the search criteria:


    template-page-newspage.php

    <snip>
    <?php
    $wp_query = new WP_Query();
    $wp_query->query( array(
    'category_name' => 'news',
    'posts_per_page' => get_option( 'posts_per_page' ),
    'paged' => $paged ) );
    $more = 0;
    ?>
    </snip>

    template-page-reviewspage.php

    <snip>
    <?php
    $wp_query = new WP_Query();
    $wp_query->query( array(
    'category_name' => 'reviews',
    'posts_per_page' => get_option( 'posts_per_page' ),
    'paged' => $paged ) );
    $more = 0;
    ?>
    </snip>

    Can anyone see what I'm doing wrong? Can I also search by tag?

    Thank you.

    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
    tg_harris

    Member

    DERP!

    I tried changing the read settings so "news" is not my "posts" page. It works better now.

    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