• I have used the footer widget to have the following pages in the footer of my site. The default is to arrange them vertically, as shown on the website right now: https://www.agoy.dk

    I’d like them to appear horizontally:

    Om AGOY |Yogaundervisning| YogaBlog |FirmaYoga

    There have been a previous post on this topic, but it’s closed to comments and it didnt solve my problem.

    Thank you in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • in widgets.css, change this:
    #footer_sitemap_widget li {
    display: inline-block;
    margin-right: 20px;
    max-width: 100%;
    vertical-align: top;
    }

    in screen.css change this:

    #footer ul.sidebar_widget li ul li
    {
    margin: 0 0 10px 0;
    padding-right: 20px;
    }

    Thread Starter agoy

    (@agoy)

    I have absolutely no idea where to insert that!

    The widget ccs says: (and please show me where the change should be made)

    <?php
    /*
    Plugin Name: Horizontal Footer Sitemap – Widget
    Plugin URI: https://URI_Of_Page_Describing_Plugin_and_Updates
    Description: A simple widget which uses the menu of your selection to show them horizontaly as a Horizontal Footer Sitemap
    Version: 1.0
    Author: Mario Shtika
    Author URI: https://mario.shtika.info
    License: GPL2
    */

    /* Start Adding Functions Below this Line */

    // Creating the widget
    class horizontal_footer_sitemap_widget extends WP_Widget {

    function __construct() {
    parent::__construct(
    // Base ID of your widget
    ‘horizontal_footer_sitemap_widget’,
    // Widget name will appear in UI
    __(‘Horizontal Footer Sitemap’, ‘horizontal_footer_sitemap_widget’),
    // Widget description
    array(‘description’ => __(‘Add a custom menu to your side bar and show it horizontaly as a Horizontal Footer Sitemap’, ‘horizontal_footer_sitemap_widget’),)
    );

    // Register style sheet.
    add_action( ‘wp_enqueue_scripts’, array( $this, ‘register_plugin_styles’ ) );
    }

    // Widget Frontend
    public function widget($args, $instance) {
    // Get menu
    $nav_menu = ! empty( $instance[‘nav_menu’] ) ? wp_get_nav_menu_object( $instance[‘nav_menu’] ) : false;

    if ( !$nav_menu ) {
    return;
    }

    echo ‘<div id=”footer_sitemap_widget”>’;
    echo $args[‘before_widget’];

    wp_nav_menu( array( ‘fallback_cb’ => ”, ‘menu’ => $nav_menu ) );

    echo $args[‘after_widget’];
    echo ‘</div>’;
    }

    public function register_plugin_styles() {
    wp_register_style(‘horizontal_footer_sitemap_widget’, plugins_url(‘/css/widget.css’, __FILE__));

    wp_enqueue_style(‘horizontal_footer_sitemap_widget’);
    }

    // Widget Backend
    public function form($instance) {
    $nav_menu = isset($instance[‘nav_menu’]) ? $instance[‘nav_menu’] : ”;

    // Get menus
    $menus = wp_get_nav_menus( array( ‘orderby’ => ‘name’ ) );

    // If no menus exists, direct the user to go and create some.
    if ( !$menus ) {
    echo ‘<p>’. sprintf( __(‘No menus have been created yet. Create some.’), admin_url(‘nav-menus.php’) ) .'</p>’;
    return;
    }
    ?>

    <?php // Widget admin form ?>
    <p>
    <label for=”<?php echo $this->get_field_id(‘nav_menu’); ?>”><?php _e(‘Select Menu:’); ?></label>
    <select id=”<?php echo $this->get_field_id(‘nav_menu’); ?>” name=”<?php echo $this->get_field_name(‘nav_menu’); ?>”>
    <option value=”0″><?php _e( ‘— Select —’ ) ?></option>
    <?php
    foreach ( $menus as $menu ) {
    echo ‘<option value=”‘ . $menu->term_id . ‘”‘
    . selected( $nav_menu, $menu->term_id, false )
    . ‘>’. esc_html( $menu->name ) . ‘</option>’;
    }
    ?>
    </select>
    </p>
    <?php
    }

    // Updating widget replacing old instances with new
    public function update($new_instance, $old_instance) {
    $instance = array();
    if (!empty($new_instance[‘nav_menu’])) {
    $instance[‘nav_menu’] = (int) $new_instance[‘nav_menu’];
    }
    return $instance;
    }

    }

    // Class horizontal_footer_sitemap_widget ends here
    // Register and load the widget
    function horizontal_footer_sitemap_widget_load_widget() {
    register_widget(‘horizontal_footer_sitemap_widget’);
    }

    add_action(‘widgets_init’, ‘horizontal_footer_sitemap_widget_load_widget’);

    /* Stop Adding Functions Below this Line */
    ?>

    Thread Starter agoy

    (@agoy)

    and where in the wp-dashboard do I find the screen.css?

    Thread Starter agoy

    (@agoy)

    Ok, I think I changed it:

    Before
    #footer_sitemap_widget li {
    display: inline-block;
    margin-right: 20px;
    max-width: 150px;
    vertical-align: top;

    After

    #footer_sitemap_widget li {
    display: inline-block;
    margin-right: 20px;
    max-width: 100%;
    vertical-align: top;
    }
    #footer_sitemap_widget li {
    font-size: 14px;
    margin-top: 20px;
    }
    #footer_sitemap_widget li a {
    border-bottom: 1px solid;
    display: block;
    margin-bottom: 15px;
    padding-bottom: 5px;
    }
    #footer_sitemap_widget .sub-menu li {
    font-size: 10px;
    margin-top: 0;
    padding: 0 2px 0 2px;
    }
    #footer_sitemap_widget .sub-menu li a {
    border-bottom: none;
    display: block;
    margin: 0;
    }

    Thread Starter agoy

    (@agoy)

    Apparently i didnt even have to change the screen.css

    But now – how do I make them spread evenly out?

    (check https://www.agoy.dk)

    How is it that I install a horizontal footer menu plugin?
    When I install the widget, the menu is vertical.

    I am going to have to say the plugin sucks and does not work worth a crap.

    pxforti.
    Your information in the above post is worthless.
    None of those entries exists.
    If you are gong to help some one, give them accurate information.
    Information that works.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to create a horizontal footer menu’ is closed to new replies.