deving.de

Hello World!
WordPress Plugin: Custom Menu Class

WordPress, ,

WordPress Plugin für voreingestellte CSS Klassen für Menü Links

CSS Klassen für Menü Links zum auswählen

Custom Menu Class ist mein erstes öffentliches WordPress Plugin. Mit diesem Plugin kann man einfach Menu CSS Klassen erstellen. Diese CSS Klassen kann man  anschließend leicht über ein Select-Feld den einzelnen Links des Menüs zuordnen, auch mehrere CSS Klassen gleichzeitig.

Custom Menu Class

Update: 0.2.0

  • Added plugin settings page for CSS classes (Options -> Menu CSS Classes)

Update: 0.2.1

  • Fullwidth select field for menu CSS classes

Update: 0.2.2

  • Bugfixes

Update: 0.2.3

  • removed deprecated argument caller_get_posts and added ignore_sticky_posts

Update: 0.2.4

  • changed wp_reset_query to wp_reset_postdata

Update: 0.2.5

  • changed WP_Query to get_posts

Update: 0.2.6

  • bugfix get_post_meta in wp 4.5
The following two tabs change content below.
Theodoros
Hello World! Begeisterter Webentwickler & SEO :)

Kommentare

  1. Can you provide a real example of how to set the CSS Classes in the file theme/functions.php?

    regards.

    • Hi,

      Copy this code to the end of functions.php

      //theme's functions.php
      add_filter('custom_menu_css_classes', 'custom_menu_classes_extra');
      
      function custom_menu_classes_extra($classes)
      {
          $classes[] = array(
              'name' => __('Footer CSS Class 1', 'custom-menu-class'),
              'class' => 'footer-class-1'
          );
          
          $classes[] = array(
              'name' => __('Footer CSS Class 2', 'custom-menu-class'),
              'class' => 'footer-class-2'
          );
      
          return $classes;
      }
    • I work on a settings page where classes can be added. I release this version in the next days.

  2. Can you tell me how to size the widget by width and align it left, center, right, etc.? I need several menu widgets to appear 3 or 4 across with titles side by side on the page, and also be mobile responsive.

    Thank you.

    • Hm, with this plugin u can set predefined CSS classes for menu items, not for widgets itself.

      • Yes, I understand that you can’t set the widget size, etc. But I need drop-down menus in widgets. Can this plugin be used place menus in widgets?

        (Please forgive me if this is a stupid question … I’m pretty new at all of this)

  3. Many thanks for your plugin. It helps. However, there is a nasty bug that is displayed in the admin side

    /wp-admin/nav-menus.php

    and looks

    Notice: WP_Query was called with an argument that is deprecated since version 3.1! „caller_get_posts“ is deprecated. Use „ignore_sticky_posts“ instead. in /var/www/vh37024/data/www/of.steffnomidi.ru/wp-includes/functions.php on line 3570

    If debugging is enabled. :( Error is not critical, but it spoils the view

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

*
*