• 0
Sign in to follow this  
Followers 0

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

Question

Posted · Report post

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') ) { ?>

<?php single_cat_title(); ?>

<?php } }

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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? http://www.pagelines.com/pros Rubyhaus's suggestion seems spot-on, but I'm unsure how to code it correctly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0