The server-side programming language that the WordPress core, plugins and themes are written in.

learn more… | top users | synonyms (1)

10
votes
1answer
2k views

How can I use WordPress functions in my stylesheet?

I have my style.php file looking like this. <?php header('Content-Type: text/css');?> #div{ background:<?php echo get_option('bgcolor');?>; } This does not work, but when I do ...
3
votes
1answer
1k views

Allow HTML in excerpt

Here is my excerpt code. // Generate custom excerpt length function wpbx_excerpt_length($length) { return 300; } add_filter('excerpt_length', 'wpbx_excerpt_length'); How do I allow html like ...
11
votes
4answers
20k views

WP insert post PHP function and Custom Fields

The wordpress function is used for submitting data programatically. Standard fields to submit to incude the content, excerpt, title, date and many more. What there is no documentation for is how to ...
1
vote
1answer
89 views

Some doubts about how the main query and the custom query works in this custom theme?

I am pretty new in WordPress theme development and I'm not so into PHP (I came from Java and C#) and have the following situation in this custom theme As you can see in the homepage I first show a ...
10
votes
5answers
3k views

Inserting terms in an Hierarchical Taxonomy

I'm really having a few issues with inserting terms. Here is my scenario: I have a taxonomy called veda_release_type: //Release Type and Region $labels = array( 'name'=> ...
9
votes
4answers
16k views

How to manually fix the WordPress gallery code using PHP in functions.php?

It's been talked many times that Wordpress outputs some really bad code for the built-in gallery function. This is the core code responsible for the gallery output (in /wp-includes/media.php): ...
14
votes
3answers
10k views

How to get WordPress Time Zone setting?

Can someone tell me how to get the time zone that is set in the WordPress Admin? For example, if the blog is set to Eastern time, I need this exact string to print out: US/Eastern This is for a ...
4
votes
1answer
1k views

How to make simply “report” button on posts

I'm building up a video-site using wordpress. It embeds videos from different sites. I really need a simply "Report broken video"-button that saves the url in a database or emails it to me. I've ...
7
votes
4answers
2k views

the_date() not working

I am using wordpress 3.2 and I did a query post like this: <?php query_posts("posts_per_page=1post=type&page=post_parent=10");?> Then I try to echo out the date of this post I queried ...
11
votes
4answers
6k views

User registration followed by automatic login

I am using a plugin modified for my purposes. What I am after is after the user has registered for it to automatically log them in and return them to the current page. At the moment it sends them an ...
3
votes
3answers
2k views

Need help with friendly URL's in Wordpress

I'm creating som custom templates in Wordpress and I'm passing some data in the URL's. Currently my URL looks like this: http://www.mysite.com/designers/?id=43&name=designer+name The URL ...
2
votes
1answer
2k views

Proper use of Output Buffer

I'm attempting to use actions to override function calls I currently have throughout a template (to make updating certain replicated sections easier). For example, in archives.php I have the ...
0
votes
2answers
300 views

Transform php code into a widget?

how can I create a widget out of a php code? It's just a disqus code that I would like to place in the sidebar. I could just paste the code in the widget section (my tag), but then I would not be ...
6
votes
1answer
3k views

How can I fetch loop of post titles via AJAX?

I have a list of the most recent post titles in sidebar.php. Here is an example of how that code looks: <?php $args = array('posts_per_page' => 20); ?> <?php $sidebar = new ...
6
votes
1answer
899 views

Allow Editors to edit pending posts but not draft ones

I have a large number of users with Editor Capabilities that help to go through the post submissions. This is my current setup for this role: As you can see, they are allowed to edit_posts and ...
4
votes
2answers
2k views

Does an activated plugin automatically mean its methods are available to other WP functions?

I made a WordPress plugin like this: Class MY_CLASS { //codes } Global $myclass; $myclass = New MY_CLASS (); After installed and activated the plugin, can I use this class in other plugins without ...
4
votes
1answer
209 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
1
vote
2answers
2k views

class=“parent” for wp_list_pages?

<div class="menu"> <ul> <?php wp_list_pages('exclude=&title_li='); ?> </ul> </div> creates the following output... <div class="menu"> ...
0
votes
1answer
266 views

Stackoverflow type of badge plugin giving warnings in Wordpress 3.5

I modified an abandoned Stackoverflow form of badge plugin to work with Wordpress 3.4.2 and it does indeed. The full script for it is here: http://pastebin.com/Ta91zXiL When upgrading to Wordpress ...
0
votes
1answer
718 views

How to Use the Function is_user_logged_in To Display Different Menus?

So, I want to create different menus for people who are logged in or not. I got a reply that i should use a function if (is_user_logged_in()) { wp_name_menu(array('theme_location' => ...
1
vote
2answers
70 views

Guidance with The Loop for CMS

Maybe I'm going about this the wrong way but this is my scenario... I would like to use WordPress as a CMS rather than a blogging platform. I have a website that will have somewhere between 25-50 ...
1
vote
2answers
2k views

Is it possible to disable a function of a parent theme?

I was wondering whether it is possible to completely disable a function that is called in a parent theme's functions.php and if so, how? (Of course without deleting the function. Rather by adding ...
0
votes
2answers
67 views

Duplicate domain database to local - How?

I've noticed that my process is rather slow and i'd like to speed it up. I want to be able to duplicate my database from my domain which is blueharlequin.com and work locally thus speeding up the ...
0
votes
1answer
803 views

How to redirect users to custom lostpassword page?

How to redirect users to custom lostpassword page when they click on the Error: Lost your password?. Because I set a redirect for wp-login.php to my custom login page. when a user click on Error: Lost ...
0
votes
1answer
240 views

Update Wordpress Custom Field with AJAX on cached page

I'm new to ajax am trying to create a simple hit counter that updates a custom field in Wordpress after the page loads. The page is cached, so any attempts to use PHP alone will not work. I'd like ...
0
votes
1answer
763 views

Add Adsense code in index.php

My wordpress blog homepage has thumbnail gallery. I want add adsense image ad code to 5,10 place. Below code from my index <?php if (have_posts()) : while (have_posts()) : the_post(); ?> ...
-1
votes
1answer
6k views

How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]

Which file (or files, if more than one) do I need to edit to re-arrange the Product Page? I want to make some basic layout changes to the default Woocommerce product page. Specifically, I want to put ...
8
votes
3answers
392 views

Make Google index the entire post if it is separated into several pages

While this is a question, it is as well a serious warning to publishers that separate their posts using <!--nextpage-->. Bare with me. I run a highly trafficked multiple author platform that ...
3
votes
1answer
2k views

Menu Items Disappearing

I'm running WP 3.5.1 and I've a menu with about 100 items. When I add new items to the menu older ones disappear. I'm not running Suhosin or similar stuff. What can be the cause? Note: I'm on a ...
2
votes
2answers
4k views

How to validate WordPress generated password in DB using PHP?

I am working with site that is done with WordPress, and I need to add some parts that are outside WP, and to check user login, Logging users outside WP. I tried with md5 of password but it's not... ...
0
votes
1answer
340 views

Metabox repeating fields - radio buttons not saving correctly

I have multiple radio buttons set up inside of a metabox in a custom post type. I have created the metabox like so: add_action('admin_init', 'add_meta_boxes', 1); function add_meta_boxes() { ...
2
votes
2answers
264 views

How can I access the “description” of a menu item?

Where you can add your menu in under appearance > menus, I have descriptions in. In my page, I want to be able to echo out that description. Not in the menu, but in my page. How can I access this ...
0
votes
1answer
101 views

Categories under custom post types doesn't show properly

I used a custom post type in my website: I added archive-{mytaxonomy}.php and also single-{mytaxonomy}.php. I also created a separate sidebar for my taxonomy and everything looks fine until I click ...
0
votes
1answer
830 views

Getting an alphabetic post list with two letters onclick on letter

I have a website in Wordpress and a page with a list with letters like this: A B C D E F G H I ... This shows me all posts with the letter A for instance. That's nice, but I want it to make it ...
0
votes
2answers
334 views

How to reduce the database query-es

Hy, i make a slide for news, the question is how can i reduce the dathabase queries...ore how can i compress this code... http://s16.postimage.org/bswe0vrph/queries.jpg <div id="featured" > ...
0
votes
3answers
145 views

How can i display 3 post types in same page?

How can i display 3 post types in same page search results. http://cinema.trancelevel.com/ For example i have post_type1-Movies post_type2-Trailers post_type3-Subtitrari Wen i search i want to ...
0
votes
2answers
501 views

I want to remove the links from the term list returned by get_the_term_list

I want to keep this category title on my pages, but I don't want it to be a link. <?php echo get_the_term_list( get_the_ID(), 'portfolio_cats', ' ', ' , ', ' '); ?> Can anyone help? Thanks
0
votes
2answers
2k views

How to order posts by modified date without using 'query_posts'?

I have an example basic wordpress theme template here for you. First, please take a quick look at it to get an idea. <?php get_header(); ?> <div id="primary"> <div ...
24
votes
6answers
3k views

Using OOP in themes

I see a lot of plugins making use of object-oriented coding when there isn't really necessary. But what's even worse is that theme developers are starting to do the same thing. Commercial themes and ...
10
votes
9answers
4k views

Adding first / last CSS classes to menus

is that possible, without javascript hacks? like this: <ul class="my_menu"> <li class="first"> ... </li> <li> ... </li> <li> ... </li> <li ...
3
votes
1answer
2k views

How do I get the $handle for all enqueued scripts?

Is there some way to get the $handle for each script that has been enqueued? Is there some array that holds all the handles so that I can loop through it and do something using each $handle?
2
votes
1answer
429 views

Ajax template: how to handle head section

I know it's easy stuff, but I'm new to this and I can't understand which is the best approach. Background The template I'm working on is a dual theme Desktop/Mobile, UA Sniffing based. Now I just ...
4
votes
4answers
15k views

How WordPress encrypt password? [duplicate]

Possible Duplicate: How to validate WordPress generated password in DB using PHP? I am working with site that is done with WordPress, and I need to add some parts that are outside WP, and ...
2
votes
1answer
2k views

Rename image uploads with width in filename

I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
2
votes
2answers
2k views

WordPress upgrade now receiving Error 101 (net::ERR_CONNECTION_RESET): Unknown error

We have just updated to WordPress 3.1.3 by following the WP manual install tutorial. Note: This is a Network-enabled (multi-site) install. After uploading the new files, we now get the following error ...
1
vote
1answer
583 views

Enqueue Javascript Correctly for 3.5

I am trying to create tabs for admin settings page in wp, but I think I'm doing it wrong. The example below shows how I did it but I don't know how to change this to use it correctly with no conflict ...
4
votes
2answers
2k views

How to change upload directory in wp_handle_upload

I am trying to work out how to use the wp_handle_upload function for a custom plugin so that i can specify my own own upload directory. The code so far takes a file from my plugin settings page and ...
2
votes
1answer
685 views

Use ajax to update_post_meta

2 days ago I asked this then I tried to work on my code to be able to understand how ajax and php work and now I have a new issue that, probably would be easily solved. These are my codes: <?php ...
1
vote
2answers
453 views

How to get all events from 'All in one Events calender' plugin in JSON format?

I am using All in one Events Calendar plugin to add the events. It works fine in CMS. I would like to display the events data in mobile version. for this i used JSON-API for obtaining web-services in ...
1
vote
1answer
1k views

Drop down+sort blog posts date added/most popular

Is it possible to have a drop down menu like youtube/demonoid that allows you to sort your index (and caterogy.php) blog posts by date/popularity/viewed)? I seen plugins for adding most popular ...