Trav3lingMan
Forum Replies Created
-
I’ve just encountered the same error, though on a live build which is exactly the same as my local build (I get no errors on the local server).
I removed the line:
<div class="wp-pagenavi"> <?php wp_link_pages('before=Pages: &pagelink=<span>'%'</span>'); ?> </div>
and replaced it with:
<div class="wp-pagenavi"> <?php get_template_part('scripts/wp-pagenavi'); if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> </div>
Same code as found in tpl_portfolio.php
Not really sure why they’re different, but the error’s gone and the nav menu still works.
After a bit more digging, I think I’ve come up with a solution (though not a very efficient one).
I did a var_dump on $terms to check the object ID for each call, and it turns out that the ID is different depending on the portfolio category under which the portfolio is filed. I’m not sure why, but the function that starts with
if($terms)
assumes that you’ll always be calling an ID of [0].Since I do not fully understand the full functionality of this call, I used a while loop to check for errors and increment the ID until the call returns no error:
$index_count = 0; $break = 0; $terms = get_terms('portfolio'); if($terms) { while($break != 1){ if(is_wp_error(get_term_link($terms[$index_count]->slug, 'portfolio'))){ $index_count++; }else{ $link = get_term_link($terms[$index_count]->slug, 'portfolio'); $name = $terms[$index_count]->name; $break = 1; } }
This fixes the problem, though I’m not sure it solves the root cause of the issue.
Please let me know what the ‘real’ solution is.. ??
Thanks!
}
I should also note that I’ve tested this on several installations, including a fresh WP/theme install with the same outcome.
I appear to be having a similar problem.
When listing portfolios, I also noticed that the ‘title’ link breaks when using categories. If no category is selected, then things are just fine and the portfolio page displays like it should.
Only certain category names appear to work, and when I have one that does not simply appending an “A” to the beginning of the name corrects the problem.
I’ve traced the problem down to the get_template_part(‘scripts/breadcrumb’) under single-myportfolio.php. It seems to fail when it reaches the section for generating the portfolio link (in breadcrumb.php):
if($terms) { $link = get_term_link($terms[0]->slug, 'portfolio'); $name = $terms[0]->name; }
I get the following error from these lines:
Notice: Undefined offset: 0 in /Library/WebServer/Documents/xxxx/wp-content/themes/wp-creativix/scripts/breadcrumb.php on line 51
Notice: Trying to get property of non-object in /Library/WebServer/Documents/xxxx/wp-content/themes/wp-creativix/scripts/breadcrumb.php on line 51
Notice: Undefined offset: 0 in /Library/WebServer/Documents/xxxx/wp-content/themes/wp-creativix/scripts/breadcrumb.php on line 52
Notice: Trying to get property of non-object in /Library/WebServer/Documents/trav3lingman/xxxx/themes/wp-creativix/scripts/breadcrumb.php on line 52This is far as I’ve managed to get, however I don’t yet understand the inner workings of wordpress / this theme to debug further.
Thanks!