• I’m currently making a portfolio website for myself. In this website I have Home, Projects, Resume, and Blog as my navigation. When someone views any of those pages I want the navigation button for the current page to have a different css styling.
    Right now in my css I have:

    .current_page_item a {
    -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; background-color: #004D86; padding-right: 10px; padding-left: 10px; padding-top: 5px; padding-bottom: 5px;
    }
    .current_page_parent a{
    	-webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; background-color: #004D86; padding-right: 10px; padding-left: 10px; padding-top: 5px; padding-bottom: 5px;
    }

    This is to style any current page menu buttons with a background color to show the user they are on that current page.
    I am also using the Simple Portfolio plugin to organize my projects. In order for Simple Portfolio to work you need to have a page with the same name as the slug of the portfolio. This stops the page content from loading and instead loads the portfolio content.

    When viewing Projects (the page that shows my portfolio content) the Projects menu button does not have different styling. Instead Blog has a different styling. When I look at the page with Firebug I notice that Projects isn’t set to the current_page_item or current_page_parent. Instead blog is set as current_page_parent.

    Does anyone know any workarounds for my current problem or if I am doing something wrong to cause this error to occur? Is there a way to stop Projects from being a parent of Blog or can I instead manually set Projects as the current page?

    I’m not extremely familiar with php or css, but I have tried various fixes and searched for all sorts of solutions.
    If there is anything else that I need to mention or code that I need to paste, let me know.

    Thanks,
    -MooKoo

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter MooKoo

    (@mookoo)

    I have also tried using the following code placed in the header:

    <style>
    
    	<?php if (is_page(projects)) { ?>
        	.page_item_7  { color: #ff8608;
    		float: left;
    			}
    
    	<?php } elseif (is_page('projects')) { ?>
    		a { color: #ff8608;
    		float: left;
    			}
    
    	<?php } elseif (is_singular('Portfolio')) { ?>
    		a { color: #ff8608;
    		float: left;
    			}
    
    	<?php } elseif (is_singular('blog')) { ?>
    		a { color: #ff8608;
    		float: left;
    			}
    
    	<?php } ?>
    	color: #ff8608;
    			}
    	</style>
    	<!-- end nav styling -->

    I put in various if statements to 1. See if I had written the code right at all and 2. To see if going to the slug portfolio is a page. For whatever reason using simple portfolio causes whatever page you link it to to no longer be a page. So is_page(‘slug’) doesn’t seem to work.

    Does anyone know of a is function that fits whatever type a simple portfolio page is turned into?

    Seems like it’s a very common problem, same is with me I want to load a specific css when ever we’re in the portfolio page:

    <?php if (is_page_template('portfolio.php') ) { ?>
    	<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_url'); ?>/css/portfolio.css" />
    <?php } ?>

    and still nothing..

    Anyone found a solution yet?

    i have a problem with notification.. im a localhost and i cant receive notification with the new user..
    can someone help me to figure this out?

    what kind of notification? are you using the simple portfolio plugin?
    Please post in the correct thread.

    Hi everyone, I found a nice simple solution, although I agree it isn’t the “most efficient one”

    First I’ve modified the header.php to include a css file to load once detected on the portfolio page:

    <?php if ( 'portfolio' == get_post_type() ) { ?>
    	<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_url'); ?>/css/portfolio.css" />
    <?php } ?>

    Second I added this to my portfolio.css file:

    #menu-item-47{
    	font-weight: bold;
    }

    I got the #menu-item-47 id using firebug so it will work only on my website, but be sure to change it to what ever ID your website has, and it will from that you can apply whatever style you want on your portfolio page.

    If anyone has a nicer solution it’s very welcome I know my solution isn’t as fancy but you don’t have to modify any source code, wordpress’ nor the plugin’s.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘simple portfolio plugin and current_page_parent problem’ is closed to new replies.