Undefined offset: 2

  • Unknown's avatar

    Hi,

    Got a site with self-made theme ( made by a web-beuro ). We use the plugin Polylang to be able to have the site multilingual.

    For its main language its working as intended, but for the secondary language I get Undefined offset: 2 error in page.php. On line 18.
    Anyone able to figure out whats wrong ?
    Here is the code;

    <?php get_header(); ?>
    
    	        <div class="content center">
    
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    				<?php the_content(); ?>
    
    				<?php endwhile; endif; ?>
    
    	        </div>
    
    			<div class="services-nav-sub">
    			<?php
    				$services_nav_object = wp_get_nav_menu_object( "Services Visual Nav" );
    				$services_nav_items = wp_get_nav_menu_items($services_nav_object->term_id);
    				$slugs = explode("/", $_SERVER["REQUEST_URI"]);
    				$cat = $slugs[2];
    				$image_align = "right";
    				foreach ( (array) $services_nav_items as $key => $services_nav_item ) {
    					$slugs = explode("/", $services_nav_item->url);
    					if ( count($slugs) > 6 ) {
    						if ( $slugs[4] == $cat) {
    							$linkhtml = '<a href="' . $services_nav_item->url . '"><span>' . $services_nav_item->title . '<small>' . $services_nav_item->attr_title . "</small></span></a>";
  • Unknown's avatar

    Hi @lmtab, it looks like you are using WordPress but you are not hosted here at WordPress.com. For self-hosted WordPress sites such as yours, I would suggest asking for help from the theme author directly or ask in the volunteer-based WordPress.org Themes and Templates forum.

    For general questions on self-hosted WordPress.org installations, visit http://wordpress.org/support/.

    The differences between WordPress.com and WordPress.org.

  • The topic ‘Undefined offset: 2’ is closed to new replies.