Jump to content


Photo

Titles not showing in Category and tag pages


Best Answer greenfly , 27 June 2014 - 01:33 PM

 

OK, did it!, Thanks for your help Martin.

 

For anyone who needs to do this, you need to..

 

Hook in before 'loop-start'

 

and enter

 

<h1><?php single_cat_title(); ?></h1>

<h2><?php echo category_description( $category_id ); ?></h2>

 

 

Great stuff - thank you for letting us know. 

Go to the full post


  • Please log in to reply
35 replies to this topic

#21 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 25 June 2014 - 01:37 PM

Hi Martin,

 

Thank you for your offer. I have just sent an email.



#22 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 25 June 2014 - 02:17 PM

Hmm, Just managed to get action map installed, but when I click on ActionMap on on the top bar, it reloads the page but shows no hook/action details, page looks the same?

 

EDIT - Scrub that, just found a later version on the github which works.


Edited by solosails, 25 June 2014 - 02:25 PM.


#23 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 25 June 2014 - 04:23 PM

I will pick your email up and reply there for you. 



#24 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 27 June 2014 - 01:27 PM

OK, did it!, Thanks for your help Martin.

 

For anyone who needs to do this, you need to..

 

Hook in before 'loop-start'

 

and enter

 

<h1><?php single_cat_title(); ?></h1>

<h2><?php echo category_description( $category_id ); ?></h2>


#25 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 27 June 2014 - 01:33 PM   Best Answer

 

OK, did it!, Thanks for your help Martin.

 

For anyone who needs to do this, you need to..

 

Hook in before 'loop-start'

 

and enter

 

<h1><?php single_cat_title(); ?></h1>

<h2><?php echo category_description( $category_id ); ?></h2>

 

 

Great stuff - thank you for letting us know. 



#26 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 27 June 2014 - 03:12 PM

Ah, Actually I haven't solved it!

 

The above works for single categories, however, I still can't get it to work for the blog page that lists all categories.

 

If I use get_title or a range of others, it just returns the title of the 1st listed blog.

 

Any idea anyone how to get the page title for the blog page?


Edited by solosails, 27 June 2014 - 03:13 PM.


#27 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 27 June 2014 - 05:31 PM

Is this the static blog page and not the single post page? 

 

You can add some page specific CSS if this is the case to hide the hook on the blog page and use a specific hook with specific content on the blog page only. 

 

Let me work this through for you and i will update you. 



#28 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 27 June 2014 - 05:33 PM

Hi, Yep, the static Blog page as set in Wordpress.

 

I cant see any hooks that are different in that page though.

 

I can get things in there using a general hook, but I cant get it to work using the the page id, it's as if the page id gets ignored



#29 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 27 June 2014 - 05:35 PM

use the page id as .blog 

 

have you tried this? 



#30 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 27 June 2014 - 05:39 PM

No,, nor does just blog, or the id number of that page 



#31 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 27 June 2014 - 05:43 PM

Sorry - my bad - i meant .news 

 

Could you try this? 



#32 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 27 June 2014 - 06:39 PM

No, that didn't work either..?

#33 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 28 June 2014 - 12:25 PM

Hi,

 

I managed to get the blog page title working by adding a content box to 'blog' template then hard coding the title.

 

Not ideal, but it works.

 

If I decide to change the name or the description of the blog page at some point, it isn't going to be automated, which is a pity, but there you go!

 

If you do find a way to get a hook working for the blog page, that would be great!

 

Thanks for your help



#34 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 01 July 2014 - 10:14 AM

Hmm, I need to rethink this.

 

Unfortunately, if I use the ?php single_cat_title(); ?> It also adds this extra title to tag pages as well as product category pages...?

 

Does pagelines group all category's and tags into one call? if so, how would I separate tags from categories?

 

  



#35 solosails

solosails

    Advanced Member

  • Members

  • 65 posts
  • Framework Version:DMS2 Personal
  • Country: Country Flag

Posted 01 July 2014 - 11:21 AM

OK,

 

I think this time I have all bases covered!

 

<?php /* If this is a category archive */ if (is_category()) { ?>
<h1><?php single_cat_title(); ?></h1><h2><em><span style="color: #b8b8b8; font-size: 15px;"><?php echo category_description(); ?></span></em></h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h1><?php single_tag_title(); ?></h1><h2><em><span style="color: #b8b8b8; font-size: 15px;"><?php echo category_description(); ?></span></em></h2>
<?php } ?>
 
This placed before the loop, will give the category pages a title and description as well as the tags, but it will not effect product archives or (as was the case for me) xml pages


#36 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 01 July 2014 - 11:59 AM

@solosails 

 

Very nice. Thank you for the very detailed updates and for the fix which will help others in future.