mp_productlist.php page title not showing

Hi,

With the main aim of just getting a custom sidebar on the store pages (that's another story) I'm having to create custom pages for product listings etc.

After a rather steep learning curve for me, delving into the themeing marketpress and template-functions pages, all is going fine with the exception that I can't get the page title to appear with my custom mp_productlist page.

On the main prodcts page http://www.denvilledesigns.com/portfolio/shop/products/ no title appears, and on category pages the post title is duplicated as the page title.

I've been searching and I thought that maybe this was the problem: https://premium.wpmudev.org/forums/topic/marketpress-231-generated-products-page-shows-no-title#post-146794

But I tried it and it didn't help, though it's possible I didn't edit the correct part.

Any help would be greatly appreciated.

Many thanks,

Shaun

  • shaunyk

    Hi,

    That's how it is set up at the moment but the_title() function returns empty, though it's not in a loop. I just tried putting it in a loop and it didn't make any difference. I even tried with my unedited page.php file and that also didn't work.

    It works fine without a custom mp_productlist.php page though so that seems to be when the problem arises.

    Here's my code:

    <div class="entry clearfix post">
    
    <?php $titletext = get_the_title(); ?>
    
    <h1 class="title"><?php the_title(); ?></h1>
    
    <div class="clear"></div>
    
    <?php mp_list_products () ?>
    
    </div> <!-- end .entry -->

    Ideally I'd just like to be able to copy the code from the default page that MP creates, though from what I gather it's not quite that simple?

    Thanks,

    Shaun

  • shaunyk

    Update:

    I've managed to get somewhere close to what I want by using:

    <h1 class="title"><?php is_home() ? bloginfo('name') : wp_title(''); ?></h1>

    instead of:

    <h1 class="title"><?php the_title(); ?></h1>

    In an ideal world I'd rather just have the words 'Online Shop' instead of the blog name on the home section but I couldn't find a way of doing it using the above code. I think I need a 'if - else' statement for that but I've already spent more time than I wanted to so I'll leave it as it is for now.

    If any PHP whizz out there can show me how it's done I'll be very grateful.

    All I wanted was a custom sidebar - LOL! Oh well I'm glad I've been forced to learn a bit of PHP so can't complain but it's delays like this that eat your profit margin!

    Ta,

    Shaun

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.