Marketpress Template Page mp_global_products.php Works, but Browsers Title Says "Page Not Found

I made a custom template page for Marketpress in my current theme for the main blog/site, mp_global_products.php. It works, but the Browsers title, as in the <title> tag, says "Page Not Found".

    counteragent
    • 3 pts
      57 pts
      LEVEL 3

    <?php get_header(); ?>
    <div id="container">
    <div id="content" role="main">
    <?php mp_list_global_products(); ?>
    </div><!-- #content -->
    <?php get_sidebar(); ?>
    </div><!-- #container -->
    <?php get_footer(); ?>

    I've stripped it down to the bare minimum and still no title. Really weird. Every other page on my site seems to work correctly and have an appropriate title. Just not any page templates I make for marketpress.

    counteragent
    • 3 pts
      57 pts
      LEVEL 3

    That is the template page. It pulls in the same header as all the other pages, posts, and products.
    There's nowhere to give it a title, unless I run a filter. It should auto generate a title just like it does without using the custom template.

    joshmac
    • 31 pts
      204 pts
      LEVEL 4

    Can you see your custom theme in the dropdown on Store Settings -> Presentation page? Have you included something like this in your template code?

    /*
    MarketPress Theme: CUSTOMNAME
    */

    drmike
    • 466 pts
      6,133 pts
      LEVEL 24

    On iPod. Excuse short. When say local dev server, is it really localhost or on web? Reason ask because known issue with a couple of specific hosts. Andrea hit this one once and figures it out. Forget who though and searching on this thong really not possible.

    counteragent
    • 3 pts
      57 pts
      LEVEL 3

    I think we're talking about two different kinds of templates. The one I'm trying to use is for Marketpress only and based on the file, "Themeing_MarketPress.txt". It's not a regular wordpress template page.

    joshmac
    • 31 pts
      204 pts
      LEVEL 4

    Yes, you are right. My first comment was about using the standard Wordpress page, but my next was referring to the instructions that come with Marketpress.

    counteragent
    • 3 pts
      57 pts
      LEVEL 3

    Well, I gave it a try and added the

    /*
    MarketPress Theme: My Custom Product Page
    */

    Still nothing. No web server errors recently. Plus, I really don't think it's my server.

    Aaron
    • 802 pts
      9,088 pts
      LEVEL 27

    Nice try guys ;-)

    You don't need a header with custom templates, thats just for the basic css templates.

    Your right in that I overlooked that the filter still needs to be applied when using custom templates. Look in the main marketpress and -ms files for the load_*_templates() methods, and you will need to copy the filter
    add_filter( 'single_post_title', array(&$this, 'page_title_output'), 99 );
    up into each block inside the section that loads the custom template if it exists. It's commented like
    //if custom template exists load it

    I'll try to fix that bug in 1.1.2 tomorrow.

    counteragent
    • 3 pts
      57 pts
      LEVEL 3

    Oh, wait, I'm not sure this is actually the bug I was referring to. I'm talking about the title in the browser, as in the <title> tag inside the <head> tag of the page. I searched through the Marketpress plugin and couldn't find any filters for "wp_title", which is how my theme page titles are pulled in. Does this make sense? Thanks again.

    Michael Kimb
    • 56 pts
      59 pts
      LEVEL 3

    Hey, just a heads up, this bug still exists.

    I made a file called mp_global_products.php and threw in the following:

    <?php get_header(); ?>
    '<div class="full-width" id="post-entry">
    '<div class="page" id="marketplace">
    '<h1 class="post-title">WordPress Theme Marketplace</h1>
    '<div class="post-content">
    '<?php mp_list_global_products('text=none&paginate=1&per_page=6&order_by=date&order=DESC&text=none&thumbnail_size=300'); ?>
    '</div>
    '</div>
    '</div>
    '<?php get_footer(); ?>

    The <title> tag on the page shows as "Page not found : sitename"

    Aaron
    • 802 pts
      9,088 pts
      LEVEL 27

    Yes, it's on my todo list. It may be a bit before I can track it down though.

    counteragent
    • 3 pts
      57 pts
      LEVEL 3

    Here's a little function I put in the functions.php page for a temporary fix.

    function fix_title($content){
    $post_slug = $_SERVER['REQUEST_URI'];
    if(strpos($post_slug,"shop")){
    return "Shop" . str_replace("Page not found","",$content);
    } else {
    return $content;
    }
    }
    add_filter('wp_title', 'fix_title', 1);

    Aaron
    • 802 pts
      9,088 pts
      LEVEL 27

    Fixed in 1.1.6.

    Note custom titles don't display yet, just the sitename. Though it's always been this way even when not using a custom template file. I'll fix that in a later release.

JOIN 388069 HAPPY MEMBERS

We pride ourselves on our level of customer support and responsiveness to member requests. Your WordPress experience will never be the same


Become a member

  • PayPal Partner