Jump to content


Photo
- - - - -

Is there a way to omit Page title markup using if/else in Functions.php?


  • Please log in to reply
2 replies to this topic

#1 rubyhaus

rubyhaus

    Advanced Member

  • Members

  • 40 posts
  • Framework Version:Always Current
  • Country: Country Flag

Posted 10 May 2012 - 04:34 AM

I'm using this snippet of code below to call up the Category Title for use of a Page Title. However if you visit my link and see the page title but then click on Contact Us and view that page title or directly above it in the white space you'll see a blank set of

tags like this:

So when I style it for Categories though blank on the Contact Us page it pushes down the page title. Any ideas on how I could enhance my Function to say Else a Page... then remove the category H1. //ADD CATEGORY TITLE AT TOP OF CAT PAGES add_action('pagelines_inside_top_postloop','cat_title'); function cat_title(){ if (is_category('news') || ('daily-inspiration') ) { ?>


#2 rubyhaus

rubyhaus

    Advanced Member

  • Members

  • 40 posts
  • Framework Version:Always Current
  • Country: Country Flag

Posted 10 May 2012 - 04:48 AM

So something like this is the ideal spec I'm going for. If: Cat: News or Cat: XYZ Show:

Else: A Page: Then remove this markup. Don't allow it to print at all.

End If. The other idea is more using inline Styling to achieve effect: If: Cat: News or Cat: XYZ Show:

Else: A Page: Then remove this markup. Don't allow it to print at all. Show:

End If.

#3 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 10 May 2012 - 06:54 PM

Unfortunately, we're the moderators aren't developers, so we couldn't write an else / if statement, but I'm sure this wouldn't take much time for one of our Pros. Have you asked them for a quote?

Please Login or Register to see this Hidden Content

Rubyhaus's suggestion seems spot-on, but I'm unsure how to code it correctly.