Home / Forums / DynamiX Support / Custom CSS Menu Placement

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts

  • Erwin Caravana
    Participant

    Hi,

    I have a css menu I made for example something like this

     

    <style media="all" type="text/css">@import "/menu/menu_style.css";</style>

    <div>

    <ul class="menu">

    <li class="top"><a href="fsdfds" target="_self" class="top_link"><span>fsd</span></a>

    </li>

    <li class="top"><a href="" target="_self" class="top_link"><span>dsfsfs</span></a>

    <ul class="sub">

    <li><a href="sdfsdfsd" target="_self">sdfsdf</a></li>

    <li><a href="" target="_self"></a></li>

    </ul>

    </li>

    <li class="top"><a href="" target="_self" class="top_link"><span></span></a>

    </li>

    </ul>

    </div>

    Where is the correct spot to place this in the header.php?

    I tried different spots and it does not want to work properly.


    Erwin Caravana
    Participant

    I also have a Javascript menu.

    <script type="text/javascript" src="http://mynge.com/site/stmenu.js"></script&gt;

    <script type="text/javascript" src="http://mynge.com/site/menu.js"&gt;

    When I paste this anywhere in the header or any page its all messed up.


    Flickapix Dezign
    Participant

    your js maybe conflicting with the themes js,also the second line of the js call has the closing script tag missing,but its better to enque the js from your functions.php,like the themes are,you can just copy and past the menu js into dynamix.min.js for simplicity,

    where you place the html will depend upon where you would like it positioned,very top,the existing menu position,below header etc,not an easy task as the slider header is slightly different to the smaller non slider header,i have my mega menu at the very top just below the buddypress admin bar.took me a couple of days to get the correct position,but heres a hint,in header.php find the header logo tag and then you should be able to work out where to position the menu,

    The css is also worth placing in the style.css file or again you can call it in the function.php

    heres how to call the css and js in functions.php:

    css:

    function custom_stylesheet() { ?>

    <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/path-to-your-file.css" />

    <?php }

    add_action('wp_head', 'custom_stylesheet');

    js:

    function my_init_method() {

        if (!is_admin()) {

    wp_deregister_script( 'mega' );    

            wp_register_script( 'mega', get_bloginfo('stylesheet_directory').'/path-to-your-file.js');

            wp_enqueue_script( 'mega' );

           

     }

    }   

    place these between the php tags.


    Flickapix Dezign
    Participant

    forgot to say,in the js function script,replace mega with your files name


    Erwin Caravana
    Participant

    Hi Flickapix,

    Thanks for the response I appreciate the help. I am still trying to figure out this coding. I understand most of it but Im a little confused in some areas.

    Sorry about that when I was copying and pasting the code I left out the ending code </script> lol. 

    I use this program called sothink dhtml menu maker since I really dont know how to code from scratch or make a complete css sprite drop down menu hehe. So when I publish the menu it comes in two parts that I have pasted above. Their basic instructions are like this.

    (Input this one into <HEAD>)

    <script type="text/javascript" src="http://mynge.com/site/stmenu.js"></script&gt;

    (Input this one into <BODY>

    <script type="text/javascript" src="http://mynge.com/site/menu.js"></script&gt;

    As you mentioned I can just copy the javascript. I copied stmenu.js into dynamix.min.js. Do I have to copy both .js file codes in there? After that how do I call the menu? Do I use that method that you wrote?

    function my_init_method() {

        if (!is_admin()) {

    wp_deregister_script( 'mega' );    

            wp_register_script( 'mega', get_bloginfo('stylesheet_directory').'/path-to-your-file.js');

            wp_enqueue_script( 'mega' );

           

     }

    }   


    Flickapix Dezign
    Participant

    if you've copied the js into dynamix.min.js then you have no need to copy the above code into the theme as dynamix.min.js is loaded with the pages.if coding menu's is a grey area for you,it would be worth you following tutorials for integrating and styling menu's in wordpress 3.1,

    this is a good site to start with: http://net.tutsplus.com

    generic menu makers are ok for html sites,but with wordpress and custom menu's you can do so much more,google for the tutorials,its worth it in the long run.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.