Forum Replies Created

Viewing 15 replies - 1 through 15 (of 50 total)
  • Thread Starter Raider000

    (@raider000)

    Solved.

    Thread Starter Raider000

    (@raider000)

    Ok another update:

    This is how I display my navigation called ‘primary_navigation’:

    <?php
    if (has_nav_menu('primary_navigation')) :
    wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav'));
    endif;
    ?>

    Like I said, this only shows me 1 sub page.

    Now I just changed the value of theme_location to ‘something’, which is not an existing menu:

    <?php
    if (has_nav_menu('primary_navigation')) :
    wp_nav_menu(array('theme_location' => 'something', 'menu_class' => 'nav'));
    endif;
    ?>

    The weird thing is that this shows me all child pages. I can’t use this though, since it includes all pages, also pages from other menus.

    Thread Starter Raider000

    (@raider000)

    Well, I think it is not really a matter of the plugin. I now deactivated the plugin – the menu in the sidebar disappears and the main navigation on the top remains. Let’s just assume I want to display all levels on the top navigation…

    This is the part of my navigation which I just temporally DELETED:

    <?php
    /**
     * Cleaner walker for wp_nav_menu()
     *
     * Walker_Nav_Menu (WordPress default) example output:
     *   <li id="menu-item-8" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8"><a href="/">Home</a></li>
     *   <li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9"><a href="/sample-page/">Sample Page</a></l
     *
     * Roots_Nav_Walker example output:
     *   <li class="menu-home"><a href="/">Home</a></li>
     *   <li class="menu-sample-page"><a href="/sample-page/">Sample Page</a></li>
     */
    class Roots_Nav_Walker extends Walker_Nav_Menu {
      function check_current($classes) {
        return preg_match('/(current[-_])|active|dropdown/', $classes);
      }
    
      function start_lvl(&$output, $depth = 0, $args = array()) {
        $output .= "\n<ul class=\"dropdown-menu\">\n";
      }
    
      function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
        $item_html = '';
        parent::start_el($item_html, $item, $depth, $args);
    
        if ($item->is_dropdown && ($depth === 0)) {
          $item_html = str_replace('<a', '<a class="dropdown-toggle"', $item_html);
        }
        elseif (stristr($item_html, 'li class="divider')) {
          $item_html = preg_replace('/<a[^>]*>.*?<\/a>/iU', '', $item_html);
        }
        elseif (stristr($item_html, 'li class="nav-header')) {
          $item_html = preg_replace('/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html);
        }
    
        $item_html = apply_filters('roots_wp_nav_menu_item', $item_html);
        $output .= $item_html;
      }
    
      function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {
        $element->is_dropdown = ((!empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth || ($max_depth === 0))));
    
        if ($element->is_dropdown) {
          if ($depth === 0) {
            $element->classes[] = 'dropdown';
          }
        }
    
        parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
      }
    }
    
    /**
     * Remove the id="" on nav menu items
     * Return 'menu-slug' for nav menu classes
     */
    function roots_nav_menu_css_class($classes, $item) {
      $slug = sanitize_title($item->title);
      $classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes);
      $classes = preg_replace('/^((menu|page)[-_\w+]+)+/', '', $classes);
    
      $classes[] = 'menu-' . $slug;
    
      $classes = array_unique($classes);
    
      return array_filter($classes, 'is_element_empty');
    }
    add_filter('nav_menu_css_class', 'roots_nav_menu_css_class', 10, 2);
    add_filter('nav_menu_item_id', '__return_null');
    
    /**
     * Clean up wp_nav_menu_args
     *
     * Remove the container
     * Use Roots_Nav_Walker() by default
     */
    function roots_nav_menu_args($args = '') {
      $roots_nav_menu_args['container'] = false;
    
      if (!$args['items_wrap']) {
        $roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
      }
    
      if (current_theme_supports('bootstrap-top-navbar')) {
        $roots_nav_menu_args['depth'] = 4;
      }
    
      if (!$args['walker']) {
        $roots_nav_menu_args['walker'] = new Roots_Nav_Walker();
      }
    
      return array_merge($args, $roots_nav_menu_args);
    }
    add_filter('wp_nav_menu_args', 'roots_nav_menu_args', 0);

    I now see the parent menu and only 1 sub menu below.

    Now that I removed almost everything which confronts with the navi, it sounds to me that there is nothing I should change, it’s maybe more something I should add?!

    Thread Starter Raider000

    (@raider000)

    I am using the simplewhiteblog. For my menus I also use the plugin Gecka Submenu Pro. I have asked the same question on their support forum but no answer yet.

    Thread Starter Raider000

    (@raider000)

    Are you serious? I don’t speak Chinese! lol

    And also I don’t thing that WooCommerce can help me out with this, since the navigation is not a WooCommerce feature. The theme I use is not getting supported anymore.

    Thread Starter Raider000

    (@raider000)

    Sure, Click here.
    There you find two menus. I would like to change the menu which is vertical.
    In this case you need to click on each parent menu to make the sub menu appear. I would like to make them appear on hovering the parent menu.

    Thread Starter Raider000

    (@raider000)

    Solution: jQuery(".upsells h2").html("Just another text");

    Thread Starter Raider000

    (@raider000)

    Update:

    I have purchased the extension WC brands and I can now easily use the shortcode [product_brand width=”64″ height=”64″ class=”alignleft”] to place the category thumbnail into the content.

    That’s a good start but I’m still forced to place that shortcode into each product page. How can I put the shortcode just at the end of the content? Is there a Hook for that or something?

    Thread Starter Raider000

    (@raider000)

    Oh that sounds weird. Are you just setting the password (using the input field next to “title”) or also activating the “Enable Password Lock” checkbox in the Package Lock Settings?

    Maybe you reset all your settings to default and try it then again. If that won’t work, you will probably need to uninstall the plugin, clear the database and try to install it again.

    Thread Starter Raider000

    (@raider000)

    Are you sure, your files are on the server? In my case I was trying to download the files from the main server but in fact they were uploaded on my test server.

    Please check if you can find your files in the directory wp-content/uploads/download-manager-files

    Thread Starter Raider000

    (@raider000)

    Uhm, I did what you said but it doesn’t show me anything. I’m sure I was doing something wrong. Maybe you want to take a look at my current code:

    global $wp_query;
    function showAllNews() {
    	query_posts('cat=1&posts_per_page=1');
    	while ( have_posts() ) : the_post();
    	?>
    	<div class="span12 news-container left-align listnews">
    		<h3><?php the_title(); ?></h3>
    		<p>
    			<?php echo substr(get_the_content(), 0, 180); ?>
    			<?php if (strlen(get_the_content()) > 180) { echo " ..."; } ?>
    		</p>
    		<a class="news-button" href="<?php the_permalink(); ?>">Read more...</a>
    	</div>
    
    	<?php
    	endwhile;
    	wp_reset_query();
    
    	$big = 999999999;
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	echo '<div class="pagination">';
    	echo paginate_links( array(
    		'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    		'format' => '?paged=%#%',
    		'current' => max( 1, get_query_var('paged') ),
    		'total' => $wp_query->max_num_pages
    	) );
    	echo '</div>';
    }
    add_shortcode('showAllNews', 'showAllNews');
    Thread Starter Raider000

    (@raider000)

    That’s nice. Thank you!

    Thread Starter Raider000

    (@raider000)

    @esmi: I am using my own theme and it’s the index.php file.
    @krissiev thanks for this but I was not asking about custom post types. Well, I could now solve my problem by using the following code:
    query_posts('cat=1&posts_per_page=3');

    Thread Starter Raider000

    (@raider000)

    This is perfect. Thank you so much!!

    Thread Starter Raider000

    (@raider000)

    Sure, the link is https://goo.gl/YA0Qa9
    On the shop pages the body class doesn’t show me anything. On all the other pages it does. E.g. Home = home page page-template page-template-template-startseite-php logged-in admin-bar no-customize-support mp6 wpb-js-composer js-comp-ver-3.5.5 vc_responsive

Viewing 15 replies - 1 through 15 (of 50 total)