wordpress

WordPress: Custom footer links doesn't show active state

Because I'm using a couple of custom post types and two languages I decided not to use WP's own menu function, and used these conditional statements instead - <div class="navigation"> <ul> <li><a <?php if(is_page('home') || is_page('hem')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo(url...

wordpress disable wptexturize() everywhere (not just in the_content() or the excerpt())

Hey great people, how can I disable wbtexturize() in my sidebar? I have a Wordpress page with the title "Paper 10x10". In my sidebar navigation this page is displayed as "Paper 10×10" (note that the x is texturized by Wordpress and therefor the x became a multiplication sign ×). I have the plugin "raw html" plugin installed. It only di...

Changing Permalinks

I want to change my permalinks from /%year%/%monthnum%/%day%/%postname%/ to /%postname%/ but when I added the following to the .htaccess file, posts didn't redirect the way I thought they would: RedirectMatch 301 /dddd/dd/dd/(.*) /$1 What do I need to put into my .htaccess file to make it work? My site is http://SweatingTheBigStuff.c...

Upload audio video files in Wordpress post/page.

Hi, How could I upload audio/video files in my wordpress post or page? Indeed there is an icon buttons to upload both type of files but when I used the Add Video button, browse a video file & update my post, I surprised that it only showed a link of that video file and when I vied it's HTML there were no tag of .... So how it is possibl...

Fatal error: Cannot redeclare happening on same line

I have been fighting with this error for a while. The error is somewhere in the function I now have php telling me it can't redeclare a variable on the same line... strange. Any help would be great. Fatal error: Cannot redeclare bp_block_admin_init() (previously declared in /home/bp-member-login-redirect/bp-member-login-redire...

Creating tables with WP plugin

Hello I'm beginning to write wordpress plugins, and I've found a situation where I need to create tables to continue. Can someone point to a decent tutorial on modifying Wordpress's database? Their usually excellent documentation seems lacking on this topic. ...

showposts VS posts_per_page. showposts works perfect but deprecated!

I'm unable to substitute posts_per_page with showposts in order to limit the number of posts returned in a list. When I use showposts, the resulting menu list is correctly displayed according to the number of posts I specify in the showposts limiter. However, when I use posts_per_page, the post limiter number appears to be irrelevant. Th...

Add custom feed to Wordpress: add_feed or do_feed

I have an existing custom feed using do_feed_* but I see there is an undocumented (and existing since 2.1) *_add_feed. Is one better than the other? I have do_feed_* working but since I upgraded to 3.0 last week, any URL with "&author=" in it redirects to the root site page. Take it out and it loads the page fine (but of course does n...

Embedding a java applet in Wordpress

I have an applet that works alright on this page. It just references the .class file. (unfortunately, I have lost the source, and the jar files.) I want to reference it here, however it does not start. Probably because it cannot find the class file. the applet tag looks like this <applet code="/applets/language/LanguageEngineApplet.cla...

Creating custom tags for Wordpress

Hello I'm creating a plugin for wordpress that'll require a couple of custom template tags for theming purposes. At the moment I have this function: function gs_subscribe_button ($type) { echo "alert"; global $wpdb; $table_name = $wpdb->prefix . "subscription_types"; $result = msql_query ("SELECT * FROM $table_name WHE...

Matching a nonquoted string

Hi- I'm trying to work with regexes in PHP on my school's news site (running WordPress). The idea is, whenever someone saves a post, all instances of "Regis" (without 'Jesuit' at the end) are replaced with "Regis Jesuit." (I go to Regis Jesuit High School, and they're picky about their branding). Overall this works fine with the followin...

Wordpress page with Categories

Hi, i wonna to create a page with list of all categories, for my template. But i can't find the way how i can do this. Maybe I have to add a new file in my template folder? Thx Best Regards ...

adding an additional link to the wp_pages_dropdown menu in wordpress

I'm working on a wordpress theme that uses dropdowns for part of the site navigation. I'm using wp_pages_dropdown and wp_dropdown_categories to output my menus as a dropdown jump menu, this is all good,works fine, but I would like to add a 'home' link to the end of the list of <option>'s I have been having a go at it - my html/css is ...

Wordpress menu and child items

Hi, how can i get the children items of an active menu in WP?! I display menu with wp_nav_menu(), but i wonna display the child items in another block. Thx ...

Edit Wordpress comment form (just add a class to the text inputs)

I'm using the default twenty_ten theme that comes with the latest Wordpress and modifying it. I just want to add a class to certain text inputs within the new comment form (specifically to add class="text" to make it play nice with Blueprint CSS framework). I can't locate the place to do this. Not au fait with PHP but able to work my wa...

Setting up an WordPress RSS feed - basics

Ok, so this is my first attempt at setting up an RSS feed. Here is what my client wants. He has a blog that he writes to about 3 times per week. He wants me to set up the RSS feed so that when he posts to his Wordpress Blog, the RSS feed generates a feed with the title of the blog. Where do i begin? Im on an Apache server, and im fa...

Is there an easy way to add multiple HTML pages to my WordPress site?

I've got ~100 static HTML pages and would like to add them to my WordPress site. They're simple HTML, with the only complicating factor being they're all linked together, so it would be best if they were all together under one directory. Will I have to do this one page at a time? Thanks, as always! ...

Wordpress two conditions (and if)

I'm writing a sidebar for my site and I'm trying to check if: The page is a post, via: is_post() The author can edit the post via: current_user_can('edit_post') I'm trying to combine both of these conditions, but I'm horrid at PHP and I just can't figure out the syntax to do so. I figured it'd be something like below. Could you pleas...

Wordpress | Automatically repost entries to the start page by date

Hi, I'm looking for a solution to regularly show a post on the startpage. The way to archieve this is to update the last modification date of a post, which can be easily done using an SQL statement. Alas this skips the regular Wordpress update hooks such as "post new entries to twitter". So I'm looking for a PHP cronjob script to "emu...

Wordpress media manager > Force image overwrite?

I'm looking for a setting or filter that I can set in my functions.php file that will force the wordpress media manager to overwrite images that are uploaded with the exact same filename as an image that already resides in the uploads folder? Currently, it creates duplicates of images with the same filename, and just adds a number to th...