Title: MathSmath's Replies | WordPress.org

---

# MathSmath

  [  ](https://wordpress.org/support/users/mathsmath/)

 *   [Profile](https://wordpress.org/support/users/mathsmath/)
 *   [Topics Started](https://wordpress.org/support/users/mathsmath/topics/)
 *   [Replies Created](https://wordpress.org/support/users/mathsmath/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/mathsmath/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/mathsmath/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/mathsmath/engagements/)
 *   [Favorites](https://wordpress.org/support/users/mathsmath/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/users/mathsmath/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/mathsmath/replies/page/2/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How To: First and Last CSS Classes for Sidebar Widgets](https://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets/)
 *  Thread Starter [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets/#post-1708671)
 * Also, as [@rarst](https://wordpress.org/support/users/rarst/) pointed out on 
   the WordPress Stack Exchange board, the section that checks for an empty sidebar
   isn’t necessary…the filter only runs pre-widget output.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How To: First and Last CSS Classes for Sidebar Widgets](https://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets/)
 *  Thread Starter [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets/#post-1708670)
 * Good call, durin!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Getting loop inside an iframe](https://wordpress.org/support/topic/getting-loop-inside-an-iframe/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/getting-loop-inside-an-iframe/#post-1601499)
 * The problem is that the files you’re trying to load (yourtheme/index.php, for
   example) can’t be loaded directly. In general (with some rare exceptions like
   the login page), WordPress doesn’t work by directly accessing files like that–
   those are TEMPLATE files that should only be accessed by WordPress itself. Know
   what I mean?
 * If you want to create a single php file that makes available WordPress functions(
   like queries and a loop), you have to do what’s called “bootstrapping” WordPress–
   loading up the WordPress framework that does all that website-generating magic–
   then manually creating a query for your loop to use.
 * Try putting the following code into a file, then save it as “news.php” in the
   root of your WP install (alongside wp-login.php, wp-config.php etc.).
 *     ```
       <?
   
       	// Bootstrap WordPress. This makes most WP functions availabe to you now.
       	require( 'wp-load.php' );
   
       	// Your php file is out on its own here, so you need to manually create a query. You can find more about queries and the arguments they accept here: http://codex.wordpress.org/Function_Reference/query_posts
       	$args = array(
       		'post_type' => 'post'
       	);
       	query_posts($args);
   
       	// Begin the loop, just like you normally would.
       	while ( have_posts() ) : the_post();
   
       ?>
   
       		<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
   
       			<h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mastercard' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
   
       			<div>
       				<?php the_excerpt(); ?>
       			</div>
   
       <?	endwhile; // end of loop ?>
       ```
   
 * Now you can call this file directly (yoursite.com/news.php), and it’ll load up
   a basic loop.
 * Hope this helps.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wp_nav_menu not working on homepage](https://wordpress.org/support/topic/wp_nav_menu-not-working-on-homepage/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wp_nav_menu-not-working-on-homepage/#post-1560852)
 * I just spent hours on the same symptom.
 * Try disabling all plugins, and look through your functions.php file to see if
   you have some code that modifies queries.
 * Don’t know if your underlying issue will be the same, but here’s what the problem
   was for me:
 * I had code in my functions.php file that was meant to include custom content 
   types in search results, feeds, etc. (this kind of code could also exist in a
   plugin you’re using, which is why I suggested turning them off). My code looked
   like this:
 *     ```
       function include_post_types($query) {
   
       	global $wp_query;
   
       	if ( !is_preview() && !is_singular() && !is_admin() ) {
   
           	$post_types = array('post', 'press-releases');
   
       		$existing_post_type = get_query_var( 'post_type' ); // Only do this if the post type is not already set
       		if ( empty( $existing_post_type ) ) {
   
       			$query->set( 'post_type' , $post_types );
   
       		}
   
       	}
   
       	return $query;
   
       }
       add_filter('pre_get_posts' , 'include_post_types');
       ```
   
 * Pretty sure I found this code (or something similar) on the forum somewhere, 
   so it’s possible other people are using it. The problem is, it assumes the global
   wp_query and the query being parsed by pre_get_posts are the same. But in custom
   queries using the WP_Query object (which the navigation widget and template tag
   uses), they’re not necessarily the same, and you might accidentally overwrite
   valid query vars.
 * I fixed it by doing something I should have done in the first place–removing 
   the reference to the global $wp_query.
 *     ```
       function include_post_types( $query ) {
   
       	if ( !is_preview() && !is_singular() && !is_admin() ) {
   
           	$post_types = array('post', 'press-releases');
   
       		$existing_post_type = $query->query_vars['post_type']; // Only do this if the post type is not already set
       		if ( empty( $existing_post_type ) ) {
   
       			$query->set( 'post_type' , $post_types );
   
       		}
   
       	}
   
       	return $query;
   
       }
       add_filter('pre_get_posts' , 'include_post_types');
       ```
   
 * Hope this helps!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Alternative page on first site visit](https://wordpress.org/support/topic/alternative-page-on-first-site-visit/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/alternative-page-on-first-site-visit/#post-1539895)
 * I would advise against doing this. Depending on how it’s implemented, some search
   engines could see this as “cloaking” and penalize or delist you.
 * It’s also kind of annoying for someone who’s visiting your site. If a user clicks
   on a link promising “tasty cookie recipes” (or whatever your site is about) and
   they get your “about” page instead, they’re probably going to bail.
 * A better idea from a technical and user experience standpoint is something like
   [WP Greet Box](http://wordpress.org/extend/plugins/wp-greet-box/). Instead of
   taking you to a separate “splash” page and making you dig for the content, it
   displays your welcome messages inline with the content the user was expecting.
   Everybody wins!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Changed URL – wrecked everything :(](https://wordpress.org/support/topic/changed-url-wrecked-everything/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/changed-url-wrecked-everything/#post-1538210)
 * Glad to see you got it working!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Changed URL – wrecked everything :(](https://wordpress.org/support/topic/changed-url-wrecked-everything/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/changed-url-wrecked-everything/#post-1538083)
 * Sorry to keep firing posts out at you, but you know what I think might have happened?
   You may have changed the URL in the wrong database.
 * If you have two WP installs (which it looks like you do), there should be two
   DBs (unless you’re using WordPress MU, which is totally not a police code). Maybe
   you “fixed” the url in the wrong one?
 * When you go into your ipage control panel (or phpmyadmin…however they’re letting
   you manage the DB), do you see two databases listed, or just one?
 * I’m about to log off, but if you’re still struggling with this tomorrow morning,
   I’ll check back and see if I can come up with any more suggestions.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Changed URL – wrecked everything :(](https://wordpress.org/support/topic/changed-url-wrecked-everything/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/changed-url-wrecked-everything/#post-1538081)
 * Oh, hey–if you haven’t already, try this fix mentioned in the [“Changing the site URL”](http://codex.wordpress.org/Changing_The_Site_URL)
   codex article:
 * _Add these two lines to your wp-config.php, where “example.com” is the NEW location
   of your site._
 *     ```
       define('WP_HOME','http://example.com');
       define('WP_SITEURL','http://example.com');
       ```
   
 * _
    This is not necessarily the best fix, it’s just hardcoding the values into
   the site itself. You won’t be able to edit them on the General settings page 
   anymore when using this method.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Changed URL – wrecked everything :(](https://wordpress.org/support/topic/changed-url-wrecked-everything/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/changed-url-wrecked-everything/#post-1538078)
 * Ah, okay. Try ADDING the www.
 * Which URL is supposed to go to which blog?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [The date – template hacks?](https://wordpress.org/support/topic/the-date-template-hacks/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/the-date-template-hacks/#post-1538074)
 * On Matt’s site, those dateless posts are set up as “asides”. Check out [this codex article about setting up asides on your blog](http://codex.wordpress.org/Adding_Asides).
 * In WP3, you’ll also be able to do this easily using custom post types–you can
   set up an unlimited amount of different posts types and have each display differently.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Changed URL – wrecked everything :(](https://wordpress.org/support/topic/changed-url-wrecked-everything/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/changed-url-wrecked-everything/#post-1538070)
 * Try changing it again, but removing the “www”.
 * Not sure how your domains are configured, but something weird is going on–if 
   you go to [http://vanessa-paris.com/](http://vanessa-paris.com/) (minus the www),
   you get one blog. If you go to [http://vanessa-paris.com/blog](http://vanessa-paris.com/blog),
   you get redirected to a completely different blog at [http://vanessaparisphotography.com/blog](http://vanessaparisphotography.com/blog).
 * Do you have two WordPress installations running on the same box? Or some kind
   of domain forwarding set up?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Comment Notifications Not Working](https://wordpress.org/support/topic/comment-notifications-not-working/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/comment-notifications-not-working/#post-1537372)
 * Some more basic things to check:
 * 1) Disable ALL your plugins and try it. (You probably already did this, but lots
   of people don’t!)
    2) Make sure the notifications are not going to your client’s
   spam folder. 3) Make sure there is nothing in your theme’s functions.php file
   that redefines the wp_mail() function or the wp_notify_postauthor() function (
   both of which are pluggable).
 * I’ve had a problem recently where some emails don’t even make it to the spam 
   folder, depending on the email provider/client. Turns out some providers automatically
   reject emails that don’t meet certain requirements, and sorting this out has 
   been a tricky business.
 * Keep me in the loop!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Deleted wp-config > Lost the Keys > ??](https://wordpress.org/support/topic/deleted-wp-config-gt-lost-the-keys-gt/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/deleted-wp-config-gt-lost-the-keys-gt/#post-1536680)
 * Good news–it doesn’t matter. Just fill those values in with new, random keys 
   and everything should be good.
 * I think these keys are only used to salt encrypted values stored in your login
   cookies, so the worst case is that any users who were logged in before you updated
   your site will have to log in again.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Printing a post](https://wordpress.org/support/topic/printing-a-post/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/printing-a-post/#post-1536672)
 * You can specify a separate stylesheet for print, and use it to hide any elements
   you don’t want to, um, print. The basic trick is this: in addition to your regular
   stylesheet, link a print-specific stylesheet like so
 * `<link rel="stylesheet" type="text/css" media="print" href="print.css" />`
 * There is a great [primer on print stylesheets over at A List Apart](http://www.alistapart.com/articles/goingtoprint/).
 * EDIT: This stylesheet will kick in whenever the print function is triggered–whether
   by window.print, or by a user selecting file->print.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to rename function by plugin?](https://wordpress.org/support/topic/how-to-rename-function-by-plugin/)
 *  [MathSmath](https://wordpress.org/support/users/mathsmath/)
 * (@mathsmath)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-rename-function-by-plugin/#post-1533537)
 * No, there is no WordPress filter that will rename php functions. The only functions
   that you can modify via plugins are the [pluggable functions](http://codex.wordpress.org/Pluggable_Functions)(
   and even those you can’t rename–that’s kinda what makes them pluggable).
 * If you explain exactly what you’re trying to do and why, we might be able to 
   come up with an acceptable solution. My best guess is that you’re trying to declare
   your own function called make_clickable(), and you’re getting an error because
   it’s already defined. In which case, you can just use a different name for your
   function and problem solved.
 * If for some strange reason you need to call the make_clickable() function but
   want to call it using a different name, you can just wrap it in your own function:
 *     ```
       function my_function_name($ret) {
   
         return make_clickable($ret); // Call the real fucntion, return the results
   
       }
       ```
   
 * If neither of those help, you’ll have to provide more info.

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/users/mathsmath/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/mathsmath/replies/page/2/?output_format=md)