Forums

Menu to P2 theme (23 posts)

  1. choibc
    Member
    Posted 2 years ago #

    Hi, I really love this theme and is using this for my church and community web sites.
    My only complain is missing "menu" feature.
    I modified theme like http://mgmkorean.org by adding stylesheet based drop-down menu.
    But, I'd like theme owner to integrate this.

    Thank you.

  2. Tevya
    Member
    Posted 2 years ago #

    Did you add the menu as a child theme? If so, any chance you'd share the child theme? I'd love to add a menu to one of my P2 based sites.

  3. choibc
    Member
    Posted 2 years ago #

    I did add menu by adding below code to header.php

    <?php
    		$locations = get_nav_menu_locations();
    		if ($locations[ 'primary-menu' ]) {
    			wp_nav_menu( array( 'container' => 'div', 'container_id' => 'madmenu', 'theme_location' => 'primary-menu' ) );
    		} else { ?>
    			<ul class='simplemenu'> <?php echo wp_list_pages('exclude=;&depth=1&sort_column=menu_order&title_li=' . ('') . '' ); ?> </ul>
    		<?php }
    	?>

    And add below codes to functions.php

    add_action( 'init', 'register_my_menu' );
    function register_my_menu() {
    	register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
    }
    add_theme_support( 'menus' );
  4. choibc
    Member
    Posted 2 years ago #

    Here is css for drop down menu.
    WP 3.0 has bug on current selected menu item.
    You should have full URL with "/" ending, then current selected menu item will work fine.

    #madmenu{float:left;padding:0;margin-top:5px;clear:both;width:100%;font-weight:bold;font-size:11px;text-transform:uppercase;background:#909090;}
    #madmenu a,#madmenu a:visited,#madmenu a:link{padding:7px 14px;margin:0;display:block;color:#ffffff;text-decoration:none;}
    #madmenu a:hover,#madmenu a:active{background:#5b5b5b;color:#fff;}
    #madmenu li{float:left;margin:0;padding:0;border-right:1px solid #303030;BACKGROUND:#909090;}
    #madmenu li a,#madmenu li a:visited{margin:0;padding:7px 14px;display:block;color:#eeeeee;}
    #madmenu li li{float:none;margin:0;padding:0;border-right:0px solid #303030;}
    #madmenu li li a,#madmenu li li a:link,#madmenu li li a:visited{padding:5px 14px;float:none;margin:0;color:#fff;background:#5b5b5b url(images/dots_nav.gif) repeat-x top;}
    #madmenu li li a:hover,#madmenu li li a:active{background:#909090;color:#fff;}
    #madmenu li li li a{padding:5px 14px;background:#909090;}
    #madmenu li li li a:hover{color:#fff;}
    #madmenu li li li a:active{color:#fff;background:#909090;}
    #madmenu li ul{width:154px;padding:0;display:none;text-transform:none;position:absolute;left:-999em;}
    #madmenu li ul ul{margin:-22px 0 0 154px;}
    #madmenu li:hover{background:#5b5b5b;}
    #madmenu li:hover ul ul,#madmenu li:hover ul ul ul,#madmenu li.sfhover ul ul,#madmenu li.sfhover ul ul ul{left:-999em;}
    #madmenu li:hover ul,#madmenu li li:hover ul,#madmenu li li li:hover ul,#madmenu li.sfhover ul,#madmenu li li.sfhover ul,#madmenu li li li.sfhover ul{display:block;left:auto;}
    #madmenu ul{float:left;padding:0;margin:0;list-style-type:none;}
    
    #madmenu li.current-menu-item a {
    	background: #fff; /*url(images/primary-menu-active.png) repeat-x 0 0; */
    	border-top: 1px solid #5b5b5b;
    	color:#000;
    	border-bottom: 2px solid #fff;
    	}
  5. Tevya
    Member
    Posted 2 years ago #

    Thank you. That's very kind of you to share. Maybe Automattic will be able to just implement your code in their upcoming update of P2.

  6. Lance Willett
    Theme Wrangler
    Posted 2 years ago #

    As discussed before there's no plan to add menus to P2. The design of the theme is such that menus are meant to be placed in the sidebar. You can add a custom menu widget or pages widget to the sidebar to achieve this.

  7. free521521521
    Member
    Posted 2 years ago #

    Can you tell me how did you all the flash party at the top fo the post?

  8. free521521521
    Member
    Posted 2 years ago #

    why I can`t got it ?
    http://test.freezhao.com

  9. Josh Carr
    Member
    Posted 2 years ago #

    @choibc

    Thank you very much! That took 2 seconds to integrate. Awesome.

    As for the lack of nav menus in the first place, not everyone wants to spit into the wind that is standardization. I wanted to integrate P2 into my pre-existing theme (I have a multi-site installation) and got everything modified except for the nav menu.

    I guess if you're doing heavy theme customization, you should be able to add in the right code for page navigation. I hack things to pieces and make it work, but I've never actually written my own php code.

    Why not make it a checkbox option or something? The theme options seem very minimal... it's a very powerful tool, but it could really have some more theme options.

    Ultimately, I used the "Page Links To" plugin to create navbar pages as if the P2 installation was actually a page of my main site. Worked wonderfully... especially if you want to add P2 capabilities to an existing site.

    See thecarrfamily.org/chat for the modified version of P2. Then "Page Links To" redirects all of the P2 navbar items to the main site's individual pages.

    You'd need a multi-site installation and a pretty heft amount of hacking know-how but the end solution worked out perfectly. I'll be doing this for all of my P2 installations from now on. Thanks again, choibc!!

  10. GodspowerOboido
    Member
    Posted 1 year ago #

    Choi BC.....I tried, but the menu is all messed up. I'm sorry I'm not quite a code person. How did you also archive the custom footer? And the flash header? Please I really need this. Do you do custom job? I hope you respond. Here is my site wwww.newspectator.com

  11. choibc
    Member
    Posted 1 year ago #

    Hi, GodspowerOboido
    Your site looks nice.
    I moved to different theme for mgmkorean.org
    Instead, http://montgomerykmc.org still has P2 modified theme.
    Header in mgmkorean.org is not flash, it is based on jQuery+CSS.
    Below php are added to main index page.

    <!-- slideshow -->
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/includes/slideshow.css" type="text/css" media="screen" />
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/jquery.cycle.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/slideshow.js"></script>
    <div id="home-top" class="clearfix">
    	<div id="slideshow" class="clearfix">
    		<div class="slides">
    			<?php query_posts("showposts=5&category_name=Headline"); ?>
    			<ul class="clearfix">
    			<?php $i = 0; while (have_posts()) : the_post(); $i++;?>
    				<li id="main-post-<?php echo $i;?>" onclick="location.href='<?php the_permalink()?>';" style="cursor: pointer; background:url(<?php echo get_the_thumb(540, 250);?>) top left no-repeat;">
    					<div class="entry">
    						<h2><a href="<?php the_permalink()?>" rel="bookmark" class="title"><?php the_title();?></a></h2>
    					</div>
    				</li>
    			<?php  endwhile;?>
    			</ul>
    		</div> <!--slide-->
    		<?php rewind_posts(); ?>
    		<ul class="slides-nav">
    		<?php $i = 0; while (have_posts()) : the_post(); $i++;?>
    			<li class="<?php if ($i == 1) echo "on"; ?> clearfix" id="post-<?php echo $i;?>">
    				<a href="#main-post-<?php echo $i;?>" title="<?php the_title();?>">
    					<?php echo the_thumb("post_thumbnail thumbnail thumbnail post_thumbnail", 150, 150);?><?php the_title();?><br />
    					<?php the_time('j M Y')?> | <?php  if (function_exists('the_views')) { the_views();}?>
    				</a>
    			</li>
    		<?php  endwhile;?>
    		</ul>
    	</div>
    </div>
  12. GodspowerOboido
    Member
    Posted 1 year ago #

    Thanks ChoiBc for the comment about my site. Thanks for the code too, unfortunately, it didn't get to work on my site. When I used it, and checked my site, I found no updates yet on the homepage. I still love the menu on your http://montgomerykmc.org site. I want it. I had tried your code in the previous comments in this thread, but didn't get it to work well....Many regards

  13. choibc
    Member
    Posted 1 year ago #

    Hi, GodspowerOboido.

    I attach file for you.
    Please use carefully since I made this long time ago...

    http://mgmkorean.org/forum/topic.php?id=6&replies=2

  14. GodspowerOboido
    Member
    Posted 1 year ago #

    Thanks ChoiBC {andy} It had a fatal error in the header and site was dead....so i had to revert back to my original p2 theme. I appreciate your generosity, thanks again. Let me not disturb you further more

  15. Kevin Ryman
    Member
    Posted 1 year ago #

    Thanks, choibc!

  16. Hai4578
    Member
    Posted 1 year ago #

    Choibc and GodspoerOboido,
    Very nice work! i wish i knew what i am doing with P2 theme. Is it possible you guys can post a video tutorial? i would really appreciated. I love both of your website.
    thank you kindly,
    Hai

  17. GodspowerOboido
    Member
    Posted 1 year ago #

    Hello Hai4578, as regards video tutorial, I do not think that would be personally possible as one does not really achieve everything at once on WP. There's been hacks and what nots to the codes and use of different plugins. However, it may help if you write what you want to achieve with your site (whats the site link?) i.e site's purpose and desired appearance. One can recommend options or perhaps write a tutorial!...Many Blessings!

  18. Hai4578
    Member
    Posted 1 year ago #

    GodspowerOboido,
    i appreciate the prompt response. i wanted to know how can i get a login area on the top right(gothamviews.com)? Sorry, but i'm pretty new to wordpress in general, so please bear with me..thanks again for the help. btw, i love your live news feeds. i definetly want to emulate your site.

  19. GodspowerOboido
    Member
    Posted 1 year ago #

    For the top right floating registration-login, use this plugin http://wordpress.org/extend/plugins/registration-login/screenshots/ and follow instructions. And as for the live news feed, use this plugin http://wordpress.org/extend/plugins/igit-posts-slider-widget/screenshots/ and perhaps u might want to work on your header

    Many Blessings,
    Godspower

  20. Hai4578
    Member
    Posted 1 year ago #

    Godspower,
    thank you! i really appreciate your help.

  21. Hai4578
    Member
    Posted 1 year ago #

    Godspower,
    thank you! i really appreciate your help and god bless.

  22. Hai4578
    Member
    Posted 1 year ago #

    Godspower,
    thank you! i really appreciate your help and god bless.

  23. Hai4578
    Member
    Posted 1 year ago #

    Godspower,
    How much coding did you change on your website? it seems like you basically hacked P2 front to back...lol. This P2 theme is driving me nuts because there so many different plugins, and not all of them work.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags