WordPress.org

Ready to get started?Download WordPress

Forums

Blix with CSS Dropdowns (4 posts)

  1. tomhal
    Member
    Posted 9 years ago #

    Hi!
    I'm trying to implement this code from AListApart: http://www.alistapart.com/articles/hybrid
    into my Blix theme to get rollover droppdown menus from the topmenu(pages).
    The code frome AListApart contains some JavaScript - is this compatible with WordPress?

    If I implement the CSS from AListApart into my WordPress CSS. What changes do I have to make in my header.php (Blix) to make this work?

    Has anyone got the time to tell me how(if it is possible) I proceed in this matter. I'm a designer not a coder (be nice to me:) but has latly been hooked on CSS and WordPress which is a very nice experience.

    Thanx to u WordPress guys for making these cool things happen.

    There maybe an alternative to what I ask for, which I have not been able to find. So if someone know a plugin or an already made solution in Blix for this request please let me know.

    As always the projects runs on thight schedules (next wednesday) so I'm happy for all the help I can get before that.

    :)tom

  2. cron
    Member
    Posted 9 years ago #

    There is no problem with javascript + wordpress. Also if you stick the css directly into your style.css then you dont have to change the header. All you have to do then is put the actual code where you want it.

    I sugest putting the code in it's own <div> tag because I have found from experence that this makes it much quicker to position it exactly where you want it.

    Cron

  3. tomhal
    Member
    Posted 9 years ago #

    Thats good news about JavaScript, but Blix uses this code to display registred pages in WordPress:

    <div id="navigation">
    <ul>
    <li<?php if (is_home()) echo " class=\"selected\""; ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php
    $pages = BX_get_pages();
    if ($pages) {
    foreach ($pages as $page) {
    $page_id = $page->ID;

    ......[more]

    How do I join the tags from the AListApart(which are very simple tags) into this code from Blix?

    Trying to keep the system as flexible as possible, but if I hardcode the links as done in the example from AListApart I loose that flexibility.

    Thanx in advance for any reply.

    ':)tom

  4. tomhal
    Member
    Posted 9 years ago #

    This is the BX_get_pages function that is refered to in the code above:
    /**
    * Function BX_get_pages
    * ------------------------------------------------------
    * Returns the following of all WP pages:
    * ID, title, name, (content)
    *
    * $withcontent specifies if the page's content will
    * also be returned
    */
    function BX_get_pages($with_content = '')
    {
    global $wpdb;
    $query = "SELECT ID, post_title, post_name FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";
    if ($with_content == "with_content") {
    $query = "SELECT ID, post_title,post_name, post_content FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";
    }
    return $wpdb->get_results($query);
    }

    I'm not sure if it will help understanding my question.

    But the bottom line is that I want to use this function and be able to get a result similar to this: http://www.alistapart.com/d/hybrid/hybrid-4.html

    :)tom

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags