How do I apply different headers to different pages using this template?
// Create header-{SLUG}.php in theme folder and add this line in your header file global $post; $slug = $post->post_name; get_header($slug);
// Create header-{SLUG}.php in theme folder and add this line in your header file global $post; $slug = $post->post_name; get_header($slug);
That’s not how you chain multiple conditions with an if statement. Try this <ul> <?php foreach ($categories as $category) { ?> <?php if ($category->name !== ‘Slides’ && $category->name !== ‘Uncategorized’) { ?> <li><?php echo $category->name; ?></li> <?php } else { ?> <li>Unknown</li> <?php } ?> <?php } ?> </ul>
method to fetch entire tag list on archive.php
You should use && instead of ||. Like: if ( !is_page(array(‘my-resumes’,’resume-listings’, ‘submit-job’, ‘submit-resume’, ‘job-alerts’, ‘job-listings’, ‘my-jobs’, ‘my-bookmarks’ ) ) && !is_singular( array( ‘job_listing’, ‘job’ )) ) { // disappear some stuff
You should use get_current_blog_id() if you need just the id and get_blog_details() if you need more fields. Be aware that get_current_site in fact gives you information about the network of sites in a WP_Network object. Yeah, the name is kind of confusing, as noted in the Codex but not yet on developer docs: Note: get_current_site() … Read more
$_SESSION Not working after X amount of page views
Have you assigned the menus to theme locations in wp-admin? If you look under Appearance > Menus, there is a Menu Settings section for each menu, and you should have the correct theme location checked under “display location.” You might also try simplifying your code. Perhaps for some reason WordPress has not yet identified which … Read more
Actually, a theme only needs 3 core files to be recognized as a proper theme. These files are: index.php styles.css functions.php If you have these 3 files in your theme’s folder, you are good to go. The point of having multiple template files is to open a way for developers and users to customize their … Read more
is_page not triggering
Why is_page() returns false when visiting the static page declared as “posts page”