technodude95
Forum Replies Created
-
Forum: Themes and Templates
In reply to: current_page_item Set with if-statementOkay, so basically, the nav bar looks like it’s using wp_nav_menu, but im not positive. What I do know is that it is dynamically generating the pages in the nav bar:
<?php if ( function_exists('wp_nav_menu') ):?> <?php wp_nav_menu( array( 'show_home' => 'Home','container' => 'globalNavi', 'theme_location' => 'primary') ); ?> <?php else: ?> <?php wp_page_menu( array( 'show_home' => 'Home', 'sort_column' => 'menu_order' ) ); ?> <?php endif; ?>
The problem right now is that I need it to use current_page_item on a post. I want it to check what category the post is, figure out which page id that translates to, and then highlight the page in the nav bar with current_page_item.
Because basically, I have different pages that have feeds of different categories. If I am on the category ‘Phones’ and click a post from within the category or the page, I still need the corresponding page highlighted on the nav bar.
Forum: Themes and Templates
In reply to: my page-template option disappeared!!Make sure that there is a distinct header text at the top of the template. If the template .php file is in the theme and shows up on the right when you go to the editor, make sure the following code is at the top of the template or you won’t be able to select it when creating a page:
<?php /* Template Name: NAME OF NEW TEMPLATE */ ?>
You need to change “NAME OF NEW TEMPLATE” to something you can identify the template with. When you update it, it should show up as a template option when you are editing the page.
Note:
If you have multiple templates for different pages, make sure the above code gives a different ‘Template Name:’ for each template.
I.E.:
First custom-template would look like this:<?php /* Template Name: About Page */ ?>
Second custom-template would look like this:
<?php /* Template Name: Contact Page */ ?>
Forum: Themes and Templates
In reply to: [Elegant Grunge] [Theme: Elegant Grunge] Change link colorsAt the top of the stylesheet, there is a section labeled:
/****************************
** General
****************************/Find that, and delete the following lines:
a {
color: #5f5f5f;
}That is overriding the link color.
Forum: Themes and Templates
In reply to: What's the file to edit the category template?It’s the ‘archive.php’ template.
I would be wary of the below method because it requires you to not only assign individual php pages to categories (which in itself requires a set of requirements for making sure the new template is formatted correctly), but also actually create a new template versus just editing one.
ANSWER:
The way that wordpress generates category pages is using the ‘archive.php’ template. Edit that and it will edit the layout of the page when anyone clicks on any category.