Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Tips, Tricks & Tutorials
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #21  
Old April 26th, 2011, 05:44 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Can you paste the code from your template that controls the menu as a reply?

Eric
  #22  
Old April 26th, 2011, 05:48 PM
onlineshopper onlineshopper is offline
 
Join Date: Mar 2011
Posts: 13
Default

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  
Old April 26th, 2011, 05:50 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

I mean the code where the wp_list_pages() code appears (usually in the header.php file).
  #24  
Old April 26th, 2011, 06:05 PM
onlineshopper onlineshopper is offline
 
Join Date: Mar 2011
Posts: 13
Default

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  
Old April 26th, 2011, 06:11 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

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  
Old April 26th, 2011, 06:31 PM
onlineshopper onlineshopper is offline
 
Join Date: Mar 2011
Posts: 13
Default

But then the menu drop down does not work. It only works if I have it as blank.
  #27  
Old April 26th, 2011, 06:45 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by onlineshopper View Post
But then the menu drop down does not work. It only works if I have it as blank.
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  
Old April 26th, 2011, 07:13 PM
onlineshopper onlineshopper is offline
 
Join Date: Mar 2011
Posts: 13
Default

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  
Old April 26th, 2011, 07:16 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Try this code in your functions.php file instead
PHP Code:
// Add store categories to nav menu
function dfr_menu_items($items) {
    
$cats str_replace(array("<div>","</div>"), array("",""), datafeedr_tag('Category List?c=%ci'));
    
$items $items $cats;
    return 
$items;
}
add_filter'wp_nav_menu_items''dfr_menu_items' ); 
  #30  
Old April 26th, 2011, 07:21 PM
onlineshopper onlineshopper is offline
 
Join Date: Mar 2011
Posts: 13
Default

Still have two sets. Is it easier to send you the backend info?
  #31  
Old April 26th, 2011, 07:27 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by onlineshopper View Post
Still have two sets. Is it easier to send you the backend info?
Sure.
  #32  
Old April 26th, 2011, 07:42 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by onlineshopper View Post
Still have two sets. Is it easier to send you the backend info?
The reason you had 2 sets is because you added them once in your functions.php file and once on your Menu's page. I deleted all of the pages you added via your Menus page and now all looks fine.

If you want to add an additional NON-datafeedr link to your nav bar, you can do so from the menus page.

Eric
  #33  
Old April 26th, 2011, 07:44 PM
onlineshopper onlineshopper is offline
 
Join Date: Mar 2011
Posts: 13
Default

Thank you so much!!!
  #34  
Old July 1st, 2011, 06:31 PM
teeshirtdrama teeshirtdrama is offline
 
Join Date: Mar 2009
Posts: 50
Default

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  
Old July 1st, 2011, 09:39 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by teeshirtdrama View Post
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.
I haven't tested it but you could try replacing this:
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]
with this:
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  
Old July 1st, 2011, 10:05 PM
teeshirtdrama teeshirtdrama is offline
 
Join Date: Mar 2009
Posts: 50
Default

Worked perfectly thanks
  #37  
Old August 20th, 2011, 01:42 AM
sylviathewitch sylviathewitch is offline
 
Join Date: Mar 2011
Posts: 155
Default

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  
Old August 20th, 2011, 02:11 AM
sylviathewitch sylviathewitch is offline
 
Join Date: Mar 2011
Posts: 155
Default

Quote:
Originally Posted by sylviathewitch View Post
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
!
Duh ... solved that myself!!!

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  
Old August 20th, 2011, 07:51 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I'm not sure if you can change the order in which the links appear. You could try changing this:
PHP Code:
    $items $items $cats
to this:
PHP Code:
    $items $cats $items
Regarding the children of 17 and Datafeedr, that's how it will work. Datafeedr cats get appended after wp_list_pages() is finished getting built.

Eric
  #40  
Old August 21st, 2011, 03:29 AM
sylviathewitch sylviathewitch is offline
 
Join Date: Mar 2011
Posts: 155
Default

Quote:
Originally Posted by Eric View Post
Regarding the children of 17 and Datafeedr, that's how it will work. Datafeedr cats get appended after wp_list_pages() is finished getting built.
The problem I have is, that I have a page:
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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:06 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.