header for multiple pages Plus the blog itself
-
Hey, folks! Bear with me – I inherited this censored site and am working on rapidly replacing it with something more well coded. However, in the meantime, I have this situation to resolve:
One portion of our website is based on WordPress, with a blog having been created but never used, and a dozen or so pages of the site being run via that blog. Now, I have a user who would really like to have the blog up and running.
If you’d like to check this out, the blog itself is https://www.riverstoneschool.org/news-events/ . If you go to https://www.riverstoneschool.org/news-events/updates-announcements/, that’s one of the pages that is currently run via the blog.
OK, the pages are working fine right now. The problem is that the blog itself, which isn’t currently used in the site, doesn’t come up properly. The cause is the header.php code, which throws a bunch of page-specific HTML code out, depending on to which of the various sections of the website the page being requested belongs. For the pages, it checks for the page Title and then uses an if tree to determine which code to generate. So far, so good, albeit clunky. Here’s a snippet of that part:
<?php if ( is_page() || is_single() ) : global $id; $id = $post->ID; $paget = c2c_get_custom('pgtitle'); if (($paget)=="high-school"){ echo ...
What I haven’t been able to work out, is how to generate code when there is no page title: for the blog itself. I’ve tried using
if (empty($paget)){ echo
and evenif (($paget)==""){ echo...
but to no avail. It’s still borked. In desperation, I even tried adding an extra variable set to the if tree, such that for every successful if:if (($paget)=="this-title" { echo('content...'); $isdone = 1; }
and then output the code if $isdone was still 0 after the if tree, but that didn’t work either. ??
Any tips will be greatly appreciated!
- The topic ‘header for multiple pages Plus the blog itself’ is closed to new replies.