Forum Replies Created

Viewing 15 replies - 166 through 180 (of 268 total)
  • If your drop-down menu appears in the middle of the page instead of attached to the parent menu, it’s probably something that needs to be resolved in your stylesheet. However, it’s not possible for any of us to know for sure without seeing your site. Could you post a link to the site?

    Forum: Themes and Templates
    In reply to: Identify theme

    It’s usually not possible to recognize a theme unless the site itself specifically posts information about it. In this case, looking at the link to the stylesheet, the only thing you can tell is that the theme being used has a slug of “euroweb_explain”.

    I think I get it. For example, in a 3-column layout, “category-2” might be assigned to posts meant for column 2 and they would therefore be summoned in their own loop.

    Yes, that is correct.

    In answer to your question, when you create a post, you can easily change the post date to whatever you want it to be; the date is not hard-coded (so to speak). You can even change the exact time of day. That is one method of changing the order, and I’m sure there are other methods that are escaping my memory at this moment. I’m certain there are many plugins that will allow you to completely customize the order of posts.

    You certainly don’t need a category for each post, as that would defeat the purpose of categories. What you need is a category for each section of your layout. Then, as you add new posts, they will automatically be placed in the correct location without you having to go into the code and move things around.

    Does that make sense?

    The short answer to “Can we do this in WordPress?” is “Yes!” The long answer is that you could certainly take the time to learn what you need and do it all yourself, but it would depend on your familiarity with the technologies that WordPress uses (PHP, MySQL, HTML, and CSS). If you’re already pretty good with these, then picking up how WordPress works probably won’t be too hard, as it is actually pretty simple.

    So, how could you direct a specific post to a particular slot in a page like this? Well, in my personal opinion, you might want to consider displaing much less all at the same time, but that’s entirely up to you. To display multiple posts in multiple slots, you can use categories and multiple loops. A simple example for the “Item” column and the “What’s Inside” column might look something like this:

    <?php
    $item_query = new WP_Query('category_name=items');
    // Loop for items
    if ( $item_query->have_posts() ) while ( $item_query->have_posts() ) : $item_query->the_post();
    ?>
    <!-- Your HTML markup of the post items goes here -->
    <?php endwhile; ?>
    <?php
    $inside_query = new WP_Query('category_name=inside');
    // Loop for What's Inside
    if ( $inside_query->have_posts() ) while ( $inside_query->have_posts() ) : $inside_query->the_post();
    ?>
    <!-- Your HTML markup of the posts for "What's Inside" goes here -->
    <?php endwhile; ?>

    Hopefully that helps you some.

    What you will probably be looking for is Unregistering a Sidebar, since there is no PHP if Statement in the TwentyTen theme.

    Take a look at the functions.php file in the TwentyTen theme. There is a section that explains how to customize with a child theme. Look for the function “twentyten_widgets_init()”. That will show you what is being registered, and you can decide what to do with it from there.

    As I suspected, this actually has nothing to do with WordPress. These are actually two separate domains, hosted on different servers. Using a website IP lookup tool (I used this site), you can see that your address without www in front has IP 184.168.238.1 and the address with www in front has IP 66.179.173.87.

    You need to contact your hosting provider to get all of your separate domains pointed to the same location if your goal is to have multiple domains that all point to the same site.

    What are the actual URLs to your site(s)?

    Your URL is currently showing the default page created by your host, with no evidence of WordPress whatsoever. If you can’t login to your host account, then you need to contact your host. Otherwise, reinstalling WordPress at the root directory (as per @root’s suggestion) will get rid of the “/wordpress” folder.

    The problem is the very first line that you posted…. The if statement that checks to see if the current page is the front page. Remove that if statement, and you should be good to go.

    Not sure if you’re still looking for the answer to this or not… However, walkers are a little bit different than filters or actions. You would need something like this in your functions.php:

    class Your_Class_Name extends Walker_Nav_Menu {
    
    function start_el(&$output, $item, $depth, $args) {
       /* Your custom code goes here.
        * I encourage you to copy the existing Walker_Nav_Menu
        * and then just make your changes.
        */
       }
    }

    Then, when you call a menu in your template files, make sure to include 'walker' => new Your_Class_Name() in your array that specifies the arguments for wp_nav_menu().

    Hope that helps….

    Thread Starter Jeremy Pry

    (@jpry)

    Well, I did manage to find what I was looking for. Turns out the there already is a rel option for the default menus. In the Menu editor, it’s labelled as “Link Relationship (XFN)”.

    I was also looking for a way to be able to make the Flex Drop Down Menu from Dynamic Drive work with the native menus, so I wouldn’t have to recreate the native menus from scratch. I’m sure there are other ways to make it work, but this is what I did to get it working (I’m posting this here in the hopes that it will help others):

    First, I created a custom field called “flexdropdown”, and set the value of the field to the ID of the menu. Then I added this code to my functions.php file:

    class Flexdropdown_Menu extends Walker_Nav_Menu {
    /**
     * @see Walker::start_el()
     * @since 3.0.0
     *
     * @param string $output Passed by reference. Used to append additional content.
     * @param object $item Menu item data object.
     * @param int $depth Depth of menu item. Used for padding.
     * @param int $current_page Menu item ID.
     * @param object $args
     */
    function start_el(&$output, $item, $depth, $args) {
    	global $wp_query;
    	$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    
    	$class_names = $value = '';
    
    	$classes = empty( $item->classes ) ? array() : (array) $item->classes;
    	$classes[] = 'menu-item-' . $item->ID;
    
    	$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
    	$class_names = ' class="' . esc_attr( $class_names ) . '"';
    
    	$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
    	$id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
    
    	$output .= $indent . '<li' . $id . $value . $class_names .'>';
    
    	$flexdata = '';
    	$custom_fields = get_post_custom( $item->object_id );
    	if ( key_exists( "flexdropdown", $custom_fields ) ) {
    	   $flexdata = ' data-flexmenu="'. get_post_meta( $item->object_id, 'flexdropdown', true) . '"';
    	}
    
    	$attributes  = ! empty( $item->attr_title ) ? ' title="'         . esc_attr( $item->attr_title ) .'"' : '';
    	$attributes .= ! empty( $item->target     ) ? ' target="'        . esc_attr( $item->target     ) .'"' : '';
    	$attributes .= ! empty( $item->xfn        ) ? ' rel="'           . esc_attr( $item->xfn        ) .'"' : '';
    	$attributes .= $flexdata;
    	$attributes .= ! empty( $item->url        ) ? ' href="'          . esc_attr( $item->url        ) .'"' : '';
    
    	$item_output = $args->before;
    	$item_output .= '<a'. $attributes . '>';
    	$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
    	$item_output .= '</a>';
    	$item_output .= $args->after;
    
    	$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
    	}
    }

    Then I created the necessary menus in my header.php:

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'walker' => new Flexdropdown_Menu() ) ); ?>
    <?php wp_nav_menu( array( 'container' => 'none', 'menu_id' => 'flexmenu1', 'menu_class' => 'flexdropdownmenu', 'theme_location' => 'image_menu' ) ); ?>
    <?php wp_nav_menu( array( 'container' => 'none', 'menu_id' => 'flexmenu2', 'menu_class' => 'flexdropdownmenu', 'theme_location' => 'services_menu' ) ); ?>

    With those in place, it was just a matter of customizing the menus on the Admin page.

    If someone sees a better way to do this, I would be interested in hearing it.

    Thread Starter Jeremy Pry

    (@jpry)

    Do you know where there might be some good examples or more detailed explanation of how to implement a walker? I’ve looked at Function_Reference/Walker_Class but it doesn’t seem to explain vey much.

    Currently, the purple highlighting as you hover over the links is because they are anchor elements, and have a style applied to a:hover. If you other text elements aren’t links, then the hover effect won’t apply to them, unless you apply it to those elements (such as p:hover). The only downside to that is that no all browsers will display a hovering effect for non-anchor elements, so just be aware of that before you try it.

    It doesn’t appear that the body attributes are overriding your sidebar… It looks like the sidebar just didn’t have the correct style applied (although that mostly seems to be corrected as I look at the site now). You may also want to use <p> tags to contain your text rather than <div> tags, as that is more conventional.

Viewing 15 replies - 166 through 180 (of 268 total)