Skip to content

Instantly share code, notes, and snippets.

@lantrix
Created February 4, 2011 02:55
Show Gist options
  • Save lantrix/810669 to your computer and use it in GitHub Desktop.
Save lantrix/810669 to your computer and use it in GitHub Desktop.
How to hardcode the Dynamic Home menu item in a Wordpress network install to your top level domain (first installation)
--- wp-includes/post-template.php 2010-12-31 07:45:18.000000000 +0000
+++ wp-includes/post-template.php.fixhome 2011-02-04 02:30:54.000000000 +0000
@@ -842,7 +842,7 @@
$class = '';
if ( is_front_page() && !is_paged() )
$class = 'class="current_page_item"';
- $menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
+ $menu .= '<li ' . $class . '><a href="http://yourtoplevelurl.com" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
// If the front page is a page, add it to the exclude list
if (get_option('show_on_front') == 'page') {
if ( !empty( $list_args['exclude'] ) ) {
@lantrix
Copy link
Author

lantrix commented Feb 4, 2011

This patch tested against Wordpress 3.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment