• Hi

    I’m using wp-dtree 3.5 and it seems to work on all pages that call it except for the front page. I’ve changed another page to be the front page, an it then worked on the former front page, but not the new one. Any one know why this might be?

    Thanks!

Viewing 1 replies (of 1 total)
  • Hello,

    I ran into the same problem. I didn’t look too deeply into it but did find a pack that works for now.

    Check the HTML generated on your front page. I saw a bunch of errors that look like:

    <b>Warning</b>: substr_count() [<a href='function.substr-count'>function.substr-count</a>]: Empty substring in <b>path-to-your-website/wordpress/wp-content/plugins/wp-dtree-30/wp-dtree_gen-functions.php</b> on line <b>180</b><br />

    Part of what the menu does is look for the current page to highlight it. It looks like it has trouble with having an empty path. Here’s my iffy solution:

    1. Find this line in /wordpress/wp-content/plugins/wp-dtree-30/wp-dtree_gen-functions.php:
      if(substr_count($string, $path)){ //we know that this line holds the node id of our request.
    2. Add this right above it (where the path is whatever is after /wordpress in your URL when you access the page directly):
      if(empty($path)) {
      	$path = "path-of-your-front-page";
      }

    This replaces an empty path with the path to the page acting as your home page.

    I’m sorry it’s ugly…

Viewing 1 replies (of 1 total)
  • The topic ‘wp-dtree does not work on front page’ is closed to new replies.