Ammaletu
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: RSS Footer] Footer appearing twice – using latest verionThe problem is the following: The plugin adds the RSS footer with two filters: the_content and the_excerpt_rss. This is fine for the full content in the feed, but not for the excerpt. The excerpt is generated getting the content (the_content filter runs, so the RSS footer is appended), stripping all HTML (including HTML in the footer), shortening it and running the excerpt filter (RSS footer is appended a second time). This is of course only a problem if you haven’t entered an excerpt manually.
The fix is to change line 160 of the plugin from
add_filter('the_content', 'embed_rssfooter');
to
add_filter('the_content_feed', 'embed_rssfooter');
I believe this is due to a bug in older WP versions where the_content was called instead of the_content_feed. It should work now for WP 2.8+ or so.
Forum: Fixing WordPress
In reply to: Adding Private Pages to WordPress 3 MenusThere is something missing from above code. In order to actually use the new walker class, you need this:
function my_wp_nav_menu_args($args) { $args['walker'] = new Walker_Nav_Menu_CMS; return $args; } add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args');
@ipstenu: Regarding the suffix: I know it’s “2, 3…” for static page name conflicts. Strangely, when I tried to create a static page with the name of an existing blog, I got the “10” suffix. Don’t know if that is really how it is supposed to work.
And now back to asafche’s problem. Sorry for partly hijacking your thread! ??
@ipstenu: I mainly read https://codex.www.ads-software.com/Create_A_Network#Permalinks where the blog prefix is mentioned. I tried to clarify this in the text with a new paragraph. I hope the wording is ok, otherwise feel free to correct it. ??
I still think this is not good design. Really strange is that a new blog overrides existing static pages. No warning — if you create a blog called “About”, your static page “About” is simply not reachable anymore. This would not be the case if the static page lived under domain.com/blog/about.
@asafche: Ipstenu has a point, normally just typing garbage in the URL should give you a 404 error code and the 404.php of the theme. Try to find out if it’s a plugin’s fault or the theme’s.
In some Trac ticket it was mentioned that it might be intentional that the static pages don’t get the “/blog” prefix. If that is the case, the codex should mention this (I’d change the text but not if I’m not sure that this is actually correct).
Now asafche, you could still have a .htaccess problem because at the moment you are not using the pretty permalinks. Calling the static pages with the ?page_id=123 link does not use the .htaccess, this goes straight to the index.php. Have you already created a second blog on the MultiSite install? You could see if the .htaccess works when you try to access any frontend page of the second blog. Those links would definitely need the .htaccess to work.
To find the source of your problem, the usual approach would be to disable all plugins and switch to the TwentyTen theme. If it does work then (with pretty permalinks enabled), you know where to search for the problem. If it doesn’t, it’s usually an issue with the server except for the rare cases where it actually is a bug in the WP core. When you try this, check that the .htaccess does contain nothing else except the WP rules.
I’d like to add to this thread if I may. I tried my first MultiSite installation today, WP 3.0.4 on a XAMPP localhost (Windows) with both MySQL and PHP a current 5.x version. I used a sub-folder installation and created a second test blog. No plugins, unmodified TwentyTen theme. Everything works fine, except the permalinks for static pages in the default blog. From what I can see at the OP’s website, it looks like it’s the same problem.
@asafche: mod_rewrite works at least partly, as you can see on pages like these: https://www.moob.me/blog/category/uncategorized/
@andrea_r and everyone else: Regardless if .htaccess works or doesn’t work — shouldn’t WP generate links for static pages as “/blog/hello-world” instead of “/hello-world”? Every other permalink on the default blog has the “/blog/” prefix, just not the static pages. My permalink structure by the way is “/year/month/title”.
Ok, there is one difference to asafche: In my case, I can see the static pages. They are displayed just fine, and when I try to create a new static page with the name of an existing blog, it gets a weird permalink with an appended “10” (e.g. “/techblog10”). So this might be two unrelated problems for the OP: WP generates the wrong permalinks (a bug?) and then the wrong permalinks don’t work.
Is there anything I can do to help clear this up? As my installation is on my local machine, I can try out pretty much anything that could help. ??
Forum: Plugins
In reply to: [plugin: RSS Footer] make it UTF-8 compatibleThanks to the plugin author for including this fix in the plugin really fast! It’s a part of version 0.9.8, so no need to manually edit this. ??
Forum: Plugins
In reply to: Cannot seem to create a tableJackosh, you have an error in the way how you specified the function to call upon activation of the plugin. That isn’t really your fault as the whole functionality is poorly documented, at best. I made the same mistake and it took me almost two hours to figure this out. :-/
So…
1) The correct call would be:
add_action('activate_[the name of your plugin folder]/wp_spinthat.php', 'st_install');
If your plugin is not in a sub-folder, the first argument needs to be ‘activate_wp_spinthat.php’. This really should be mentioned in the codex (even if it might seem obvious to experienced users).
2) The way I understand it, we are not supposed to call add_action directly to register a function for a plugin activation hook. That’s what the function register_activation_hook() is for. Important: This function takes the same arguments, but without the ‘activate_’ part on the first.
3) If you want to avoid hard-coding the folder and file names of your plugin (might change in the future and you would need to remember changing them here then), then you can use this as the first argument:
plugin_basename(__FILE__)
This function will automatically generate the folder and file name of the current file.So, for your example that would be:
register_activation_hook(plugin_basename(__FILE__), 'st_install');
4) If you intend to use plugin_basename() on a Windows machine (e.g. for local testing), have a look at https://trac.www.ads-software.com/ticket/3002 –> There’s a bug in WP. It has been fixed and will apparently be part of WP 2.3. If you want to use plugin_basename right away, just apply the patch that’s attached to the bug report. Worked for me.