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

    joshmac

    Hello @counteragent and welcome to WPMU Dev. Can we get a link to your site?

    joshmac

    Gotcha, is there a title code being used in mp_global_products.php? If so, can you paste it here?

    counteragent
    • 57
    • #2,007

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

    joshmac

    And you created a Wordpress page based on this template and gave it a title?

    counteragent
    • 57
    • #2,007

    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

    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

    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
    • 57
    • #2,007

    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.

    drmike

    Also please check webswrvers error logs please. :)

    joshmac

    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
    • 57
    • #2,007

    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.

    joshmac

    @counteragent, does it at least show in the drop down?

    Aaron

    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
    • 57
    • #2,007

    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
    • 59
    • #1,940

    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

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

    counteragent
    • 57
    • #2,007

    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

    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.

    Michael Kimb
    • 59
    • #1,940

    Thanks Aaron, counteragent's fix is actually pretty sweet anyway :)

Join 368618 happy members

Get access to our entire collection of epic plugins, astonishing themes & genius support

Become a member