![]() |
|
Home | Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
Thread Tools | Search this Thread | Display Modes |
#21
|
||||
|
||||
![]() Hi
Can you paste the code from your template that controls the menu as a reply? Eric
__________________
![]() ![]() ![]() ![]() |
#22
|
|||
|
|||
![]() I have the following code in functions.php in my child theme folder:
<?php // Filter wp_nav_menu() to add additional links and other output function new_nav_menu_items($items) { $cats = str_replace(array("<div>","</div>"), array("",""), datafeedr_tag('Category List?c=%ci')); $items = $items . $cats; return $items; } add_filter( 'wp_list_pages', 'new_nav_menu_items' ); add_filter( 'wp_nav_menu_primary_items', 'new_nav_menu_items' ); ?> |
#23
|
||||
|
||||
![]() I mean the code where the wp_list_pages() code appears (usually in the header.php file).
__________________
![]() ![]() ![]() ![]() |
#24
|
|||
|
|||
![]() I can't find wp_list_pages in the header.php file:
<?php /** * The Header for our theme. * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <title><?php /* * Print the <title> tag based on what is being viewed. */ global $page, $paged; wp_title( '|', true, 'right' ); // Add the blog name. bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) echo " | $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <?php /* We add some JavaScript to pages with the comment form * to support sites with threaded comments (when in use). */ if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. */ wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="wrapper" class="hfeed"> <div id="header"> <div id="masthead"> <div id="branding" role="banner"> <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?> <<?php echo $heading_tag; ?> id="site-title"> <span> <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a> </span> </<?php echo $heading_tag; ?>> <div id="site-description"><?php bloginfo( 'description' ); ?></div> <?php // Check if this is a post or page, if it has a thumbnail, and if it's a big one if ( is_singular() && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) && $image[1] >= HEADER_IMAGE_WIDTH ) : // Houston, we have a new header image! echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); else : ?> <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> <?php endif; ?> </div><!-- #branding --> <div id="access" role="navigation"> <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?> <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> </div><!-- #access --> </div><!-- #masthead --> </div><!-- #header --> <div id="main"> |
#25
|
||||
|
||||
![]() Hi
It appears that you are using the built in Menus page. If that's the case, you can easily configure it like I've done to mine: ![]() Eric
__________________
![]() ![]() ![]() ![]() |
#26
|
|||
|
|||
![]() But then the menu drop down does not work. It only works if I have it as blank.
|
#27
|
||||
|
||||
![]() It looks like WP changed some of their menu code. I have updated the code in the first post of this thread. Now it also works for me.
__________________
![]() ![]() ![]() ![]() |
#28
|
|||
|
|||
![]() I am so sorry Eric. I feel so helpless. I added the code to the functions.php. Now I have two sets of categories in my menu. One with a drop down and one without. I think I should take some of the code out, but don't know which one.
|
#29
|
||||
|
||||
![]() Try this code in your functions.php file instead
PHP Code:
__________________
![]() ![]() ![]() ![]() |
#30
|
|||
|
|||
![]() Still have two sets. Is it easier to send you the backend info?
|
#31
|
||||
|
||||
![]() Sure.
__________________
![]() ![]() ![]() ![]() |
#32
|
||||
|
||||
![]() Quote:
If you want to add an additional NON-datafeedr link to your nav bar, you can do so from the menus page. Eric
__________________
![]() ![]() ![]() ![]() |
#33
|
|||
|
|||
![]() Thank you so much!!!
|
#34
|
|||
|
|||
![]() Hi
I followed the instructions above and all my datafeedr categories were added to my home page menu. Is there a way to make one menu option such as store and then make it so all the categories fall under this or drop down? It may be mentioned but just do not understand exactly how that can be done. |
#35
|
||||
|
||||
![]() Quote:
HTML Code:
[category.list id='dfparent' before='' after=''] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> [category.list id='dfchild' before='<ul>' after='</ul>'] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> [category.repeat id='dfchild'] </li> [/category.list] </li> [/category.list] HTML Code:
<li> <a href="/store">Store</a> [category.list id='dfparent' before='<ul>' after='</ul>'] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> [category.list id='dfchild' before='<ul>' after='</ul>'] <li> <a href="[category.link]" title="[category.name]">[category.name]</a> [category.repeat id='dfchild'] </li> [/category.list] </li> [/category.list] </li>
__________________
![]() ![]() ![]() ![]() |
#36
|
|||
|
|||
![]() Worked perfectly thanks
|
#37
|
|||
|
|||
![]() I have added the drop down menu (named "shopping kategorien") to my site
http://omasgeheimnisse.com/shop16/ Everything works great, except the top navigation link to "Shopping Kategorien". It calls "http://omasgeheimnisse.com/store", which does not exist. How can I either remove this link or call the correct link, which would be http://omasgeheimnisse.com/shop16/weinshop Futhermore I would like to know, if there is a way to rearrange the order on where the "shopping kategorien" appear in the navigation menu. I would like to have them right after "home" instead of the very left. Thanks a lot!!! |
#38
|
|||
|
|||
![]() Quote:
![]() Now I only have the problem with rearranging the order. And another question just came up: I use wp_list_pages, now when I use <?php wp_list_pages('title_li=&child_of=17'.$post->ID.'&show_date=modified &date_format=$date_format'); ?> I do not only get the children of page 17, but also all categories from datafeedr ![]() |
#39
|
||||
|
||||
![]() Hi
I'm not sure if you can change the order in which the links appear. You could try changing this: PHP Code:
PHP Code:
Eric
__________________
![]() ![]() ![]() ![]() |
#40
|
|||
|
|||
![]() Quote:
http://omasgeheimnisse.com/shop16/rotweine-2/ that only is supposed to call <?php wp_list_pages('title_li=&child_of=17'.$post->ID.'&date_format=$date_format'); ?> Which means only pages, that are child of page 17. The only available page is http://omasgeheimnisse.com/shop16/ne...n-auktionen-2/ which is shown on top of the results as "Rotweine", but below I also get all datafeedr categories, which are not child of page 17. The datafeedr categories show on each and every page/post that is calling wp_list_pages, regardless of the child_of. Is there a way to fix this, or can I simply not append Datafeedr to primary menu when I have pages/posts that call wp_list_pages? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|