Advertisement
Guest User

Network Fixes

a guest
Oct 10th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.50 KB | None | 0 0
  1.  
  2. NETWORK TEMPLATE BUG & VALIDATION FIXES
  3.  
  4. Affects the following files
  5.  
  6. wp-content/themes/network/home.php
  7. wp-content/themes/network/template-blognews.php
  8. wp-content/themes/network/page.php
  9. wp-content/themes/network/footer.php
  10. wp-content/themes/network/library/components/feature-content.php
  11. wp-content/themes/network/library/components/discover-header.php
  12. /wp-content/themes/network/template-fullwidth.php
  13.  
  14. Adds file searchform.php to /wp-content/themes/network/
  15.  
  16. (NOTE: If the hard coding option is chosen changes will include /wp-includes/general-template.php)
  17.  
  18. --------------------------------------------------------------------------------------------
  19.  
  20. wp-content/themes/network/home.php add "</div>" on line before "<?php get_footer() ?>"
  21.  
  22. --------------------------------------------------------------------------------------------
  23.  
  24. wp-content/themes/network/template-blognews.php - Add 2X "</div>" before "<?php get_footer() ?>"
  25.  
  26. --------------------------------------------------------------------------------------------
  27.  
  28. wp-content/themes/network/page.php - Add 2X "</div>" before "<?php get_footer() ?>"
  29.  
  30. (NOTE: This fixes some things, but leaves validation errors that I was unable to locate within the theme files)
  31.  
  32. --------------------------------------------------------------------------------------------
  33.  
  34. wp-content/themes/network/footer.php - Add "</div>" to line 28 just before "</body>"
  35.  
  36. --------------------------------------------------------------------------------------------
  37.  
  38. wp-content/themes/network/library/components/feature-content.php
  39.  
  40. Find the following lines around line 29
  41.  
  42.  
  43.         nav_label_first : '<?php if ($homepage_label_first) { echo $homepage_label_first; } else { echo "<< first"; } ?>',
  44.         nav_label_last : '<?php if ($homepage_label_last) { echo $homepage_label_last; } else { echo "last >>"; } ?>',
  45.         nav_label_prev : '<?php if ($homepage_label_prev) { echo $homepage_label_prev; } else { echo "< prev"; } ?>',
  46.         nav_label_next : '<?php if ($homepage_label_next) { echo $homepage_label_next; } else { echo "next >"; } ?>'   
  47.  
  48.  
  49.  
  50. Replace with
  51.  
  52.         nav_label_first : '<?php if ($homepage_label_first) { echo $homepage_label_first; } else { echo "&laquo; &laquo;first"; } ?>',
  53.         nav_label_last : '<?php if ($homepage_label_last) { echo $homepage_label_last; } else { echo "last &raquo; &raquo;"; } ?>',
  54.         nav_label_prev : '<?php if ($homepage_label_prev) { echo $homepage_label_prev; } else { echo "&laquo; prev"; } ?>',
  55.         nav_label_next : '<?php if ($homepage_label_next) { echo $homepage_label_next; } else { echo "next &raquo;"; } ?>
  56.        
  57. --------------------------------------------------------------------------------------------
  58.  
  59. wp-content/themes/network/library/components/discover-header.php
  60.  
  61. 1. Find the following around line 26
  62.  
  63.         <div class="submit-button"><input name="wp-submit" id="wp-submit" value="Log In" tabindex="100" type="submit"></div>
  64.  
  65. Replace with
  66.  
  67.         <div class="submit-button"><input name="wp-submit" id="wp-submit" value="Log In" tabindex="100" type="submit" /></div>
  68.        
  69. ####################
  70.        
  71. 2. Find the following around line 27
  72.  
  73. <input name="redirect_to" value="<?php echo get_option('siteurl'); ?>/wp-admin/" type="hidden">
  74.  
  75. Replace with
  76.  
  77. <input name="redirect_to" value="<?php echo get_option('siteurl'); ?>/wp-admin/" type="hidden" />
  78.  
  79. ####################
  80.  
  81. 3. Find the following around line 28
  82.  
  83. <input name="testcookie" value="1" type="hidden">
  84.  
  85. Replace with
  86.  
  87. <input name="testcookie" value="1" type="hidden" />
  88.  
  89. --------------------------------------------------------------------------------------------
  90.  
  91. /wp-content/themes/network/template-fullwidth.php
  92.  
  93. 1. Find '<?php get_header() ?>' around line 7
  94.  
  95. Copy it, remove it from where it is and place it just above '<div id="container-background">'
  96.  
  97. ####################
  98.  
  99. 2. Add 2X '</div>' just before '<?php get_footer() ?>'
  100.        
  101. --------------------------------------------------------------------------------------------
  102.  
  103. Non theme related bug causing site to not validate - per http://core.trac.wordpress.org/ticket/10108
  104.  
  105. Create a form called 'searchform.php' and add the following code :
  106.  
  107. #######################################################################################
  108.  
  109. <?php  
  110.    
  111.     $form = '<form method="get" id="searchform" action="' . home_url( '/' ) . '" >
  112.     <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
  113.     <input type="text" value="' . get_search_query() . '" name="s" id="s" />
  114.     <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
  115.     </div>
  116.     </form>';
  117.    
  118. ?>
  119.  
  120. ########################################################################################
  121.  
  122. Place searchform.php in either the root of your network theme or child-theme folder. ( e.g. /wp-content/themes/network )
  123.  
  124. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  125.  
  126. Alternatively, you can fix this by changing the hard coding in the WordPress core (less desirable as it will get overwritten on WP update)
  127.  
  128. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  129.  
  130. To change the hard coding........
  131.  
  132. /wp-includes/general-template.php
  133.  
  134. Find the following around line 160
  135.  
  136. $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
  137.  
  138. Replace with
  139.  
  140. $form = '<form method="get" id="searchform" action="' . home_url( '/' ) . '" >
  141.  
  142. --------------------------------------------------------------------------------------------
  143.  
  144.  
  145.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement