Tag Info

Hot answers tagged

5

SOLUTION: after_switch_theme does exactly what I intended here. It fires after the theme is switched TO your theme. One of the solutions mentioned below uses switch_theme. This does not have the desired results, since it only happens upon switching away from your theme. Here is an article that I found as reference: ...


4

The after_setup_theme action is intended to fire on every WordPress load. It is simply part of the process during which WordPress invokes the template system, determines the various setup parameters for the Theme, and then proceeds on with subsequent processing, such as determining the correct template to display, etc. In other words, the after_setup_theme ...


4

You're misinterpreting the is_admin() function. It's not a tag to check whether or not the user is an admin, it's a template tag to check if you're on an admin page. From the Codex: This Conditional Tag checks if the Dashboard or the administration panel is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE. You're ...


4

No, apparently not. Until this behavior is changed in version 3.7 you can add this filter to your theme's functions.php file to include additional extensions. Edited: I've updated the filter with better code suggested in the comments. Lower case and uppercase extensions function my_custom_audio_extensions( $exts ) { //merge array of upper case ...


4

Looks like this is a defect. Ish. As @s_ha_dum mentioned, this is to prevent a directory traversal attack. However, Wordpress' Media Library will happily let you upload a file with two or more periods in a row, even if ms-files.php will refuse to serve it up. So, nothing is technically "broken", but this certainly isn't ideal. There's a patch to prevent ...


3

The is_admin() only checks for if current visitor is on admin page or not. To block any non admin user from visting any admin page use current_user_can(); function. Here's an example to check if current user is not a admin. if ( ! current_user_can( 'manage_options' ) ) { echo 'You should not see this if you\'re not logged in!'; } #1 Update - ...


3

Are you by chance using Firefox to test your page? If so its prefetching function combined with WordPress rel='next' could be the culprit. Check your page source for those rel tags, and see if Firebug registers an extra GET request to the page specified in the href attribute of the rel tag. There is a Firefox extension Fasterfox, and it will prefetch ...


2

My suspicion is that, for some reason, the name "51m series" or slug 51m-series is (or both are) matching is_category( 51 ). The is_category() function uses the PHP in_array() conditional to match against ID, slug, and name: if ( in_array( $cat_obj->term_id, $category ) ) return true; elseif ( in_array( $cat_obj->name, $category ) ) return ...


2

Plugins with Network: true in their header cannot be seen, activated or deactivated in sub sites. The reason is simple: You need super admin rights to do something with them, and their settings section (if there are any) are visible in wp-admin/network/ only. Even if you are the super admin and on a sub site you will not see those menus usually, because the ...


2

Unfortunately there is no theme-activation hook. However, a this question does provide a work-around for that. Simply use the 'theme activation hook' to activate the plug-ins. A better solution, along the same vein is this one. Both essentially use the switch_theme hook. As per the OP comments and the linked trac ticket - after_switch_theme is the hook ...


2

From PHP docs (emphasis mine): preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match. preg_match_all() on the contrary will continue until it reaches the end of subject.


1

TinyMCE is generally cross-browser compatible. However they provide the best support for IE, Firefox and Safari. I've never ran into problems with my beloved Opera too. http://www.tinymce.com/wiki.php/Browser_compatiblity If there are any bugs they're mostly not browser-dependent, but if they are - try Firefox, Safari, Opera, IE - in that order.


1

The Bug …is well known, but it's not a bug. It's an Error, that you don't display. The Fix Move into your ~/wp-config.php file. Then add define( 'WP_DEBUG', true ); and read your Error message.


1

Try the fix posted here: http://sourceforge.net/tracker/?func=detail&aid=3485384&group_id=315685&atid=1328061 It worked for me. translations.php line 726 Change this: $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+))(;{0,1})$/is'; to this: $pattern = '/LIMIT\s(\d+)((\s*,?\s*)(\d+)*);{0,1}$/is'; Removing the extra parentheses allows ...


1

I had the same issue and it was resolved by changing the translations.php file as indicated in this post on the official DB Abstraction forums. The following code: // Check for true offset if ( count($limit_matches) == 5 && $limit_matches[1] != '0' ) { $true_offset = true; } elseif ( count($limit_matches) == 5 && $limit_matches[1] == ...


1

I asked the same question a while ago. Scribu gave me an answer here. The long and short of it: after you insert your terms, add this line of code. delete_option("my_custom_taxonomy_children"); Of course, replace my_custom_taxonomy with your own, but leave the _children part.


1

It appears that you're intending to redirect the user to a certain page, after the user posts a comment? If so: why are you hooking into get_commenet_link for this redirect? The get_comment_link() function is intended to return the permalink to a given comment. The get_comment_link filter is intended to filer the comment permalink returned by ...


1

Sounds like a couple of possibilities 1) an upgrade that may not have completed successfully or fully - try reloading wordpress completely (download and ftp). This has happening to a few folk or 2) a plugin that may not be compatible with new version. For debugging purposes, try deactivating one by one till problem goes away (or deactivate all, then ...


1

Where/how are you defining $category_id? Reference the Codex entry for WP_Query() category parameters. WP_Query() expects category IDs to be passed as integers, not as strings: If $category_id is an integer, pass it to 'cat'. If $category_id is an array (of category IDs, again as integers), pass it to 'category__in'


1

I believe @JMau is referring to the following: The actual image is only 211px wide, it displays at 281px wide, therefore pixelation is occurring. The bigger issue here is that the little thumbnail image displaying to the left of the main product image is throwing the alignment off. Add the following to your custom CSS styles to fix the alignment: ...



Only top voted, non community-wiki answers of a minimum length are eligible