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

learn more… | top users | synonyms (1)

5
votes
2answers
2k views

How to Remove all Instances of edit_post_link

Can someone please assist with how to remove from my theme, whilst in author mode, the edit_post_link (Edit link), throughout all my pages. Which php files in the Twenty Eleven theme (WordPress v3.2) ...
4
votes
1answer
1k views

Searching users with WP_List_Table plug-in

I am trying to devlope a plugin that will search and return my users so I can edit some other metatdata that belongs to them. I have been using the plug-in listed on the Codex as my starting point. I ...
3
votes
3answers
20k views

How to set and use global variables? Or why not to use them at all

UPDATE: My original question has been solved, but this is turning into a valid discussion about why not to use global variables, so I am updating the question to reflect that. The solution was ...
2
votes
1answer
254 views

Has anyone tried putting PHP ActiveRecord on Wordpress?

I have worked with Ruby on Rails and I was looking for some code that did something close to the wonderfull RoR's ActiveRecord. I stepped by this site. Its PHP-ActiveRecord! I found it amazing, and ...
2
votes
2answers
325 views

How to stop loading multiple copies of jquery

My wordpress header.php and function.php is given below.please help me to modify my php code to stop problems due to loading jquery multiple times. My plugins and themes are loading jquery multiple ...
2
votes
1answer
330 views

Getting the Current User

I am trying to use information about the current user in a plugin that I am designing and I have seen people go about it in several different ways. My Way This way seems to work, but am I missing ...
2
votes
2answers
902 views

How to use nonce with front end submission form?

Thanks to a variety of posts on here I've managed to put together a front end submission form. After about 24 hours of tweaking I've finally got everything working including a redirect to a 'success' ...
2
votes
3answers
5k views

Facebook Comment Count

I am a bit of an amateur when it comes to PHP and WordPress but I have rigged up the following code: function fb_comment_count($url = 'some url here') { $filecontent = ...
2
votes
1answer
1k views

media_handle_upload weird thing

I am using a front end script to upload images , all works fine but recently i noticed the uploaded images are not saved in proper directory. My settings are to Organize my uploads into month- and ...
1
vote
1answer
278 views

Customized title tag for each page in pagination?

With the reference of below questions. How to change title tags on paginated posts? Paginate tags page How to change title tags on paginated posts? Add Page number to Meta Description in Wordpress SEO ...
1
vote
2answers
131 views

Why is my get_post_meta always empty

I made this action hook which will send an email to the users every time a new post in the custom post type "events" is made. function email_members($post_id) { global $wpdb; $usersarray = ...
1
vote
2answers
1k views

wp enqueue style and style sheet depth

How could I add a style sheet at the bottom of the <head> tag, so if there´s a need to override some other styles added before, it will override. I heard something about wp_enqueue_style, and ...
1
vote
2answers
6k views

Wordpress redirect to landing page if not logged in

I'm using the following code in my functions.php file to redirect users who are not logged in to a particular landing page <?php if(!is_user_logged_in()) { wp_redirect( ...
1
vote
1answer
126 views

which action to hook to in order to perform post-publish action

I have some functionality I've written in order to post the title and link for the post to twitter whenever a post is published. I'm wondering which wp function to hook this to? save_post has no real ...
1
vote
3answers
130 views

How to configure self hosted wordpress so that everything can be upgraded/installed from dashboard

I have a blog on shiplu.mokadd.im. After installing wordpress I see upgrade notice time to time. Sometimes its core upgrade and sometimes its plugin or theme upgrade. Each time I try to upgade any of ...
1
vote
1answer
3k views

Front end submit form with jquery form plugin

Maybe someone can help me with a small problem I'm having. I'm trying to use this: http://jquery.malsup.com/form/ to create a submit form for Wordpress. I've tested it on a regular site(not WP) and it ...
1
vote
2answers
106 views

How can I include PHP-Code to my post?

I would like to use PHP in some posts. These posts should look like normal posts, be in the archive and categories like normal posts an have tags. I don't need PHP in every post, but it would be ...
1
vote
1answer
170 views

Is Auto Post recognition a WordPress feature? How to turn it off?

I noticed that if you go to lostlettermen.com/aa, it redirects to a post. Is this a feature in WordPress that can be turned off, or is this done by some type of plugin or custom code?
1
vote
1answer
344 views

Match checkbox data with page title to show certain items

I want to show the projects that has had it's checkbox ticked as Branding, if it's on the Branding page (i.e the page title is Branding). To explain the code a bit: This line show's all the ...
1
vote
2answers
4k views

Show dialog box in TinyMCE plugin and use WordPress php functions in it

I'm adding a TinyMCE button to my plugin. So far, I've been able to add the button and call my editor_plugin.js file and it's command. Not an easy mission btw... I want this button to show a Dialog ...
0
votes
1answer
925 views

Search that will look in custom field, post title and post content

I am looking for a way to perform a search, and while performing the search, it checks a custom field named keywords, the post title and the post content. If any of those fields have results like what ...
0
votes
2answers
126 views

Limit checklist by the current user

Bare with me as I explain this. I'm adding an Assistant Editor feature to my multiple author platform. In the box that appears in post-edit page, the Editors can tick which task that they have done ...
0
votes
1answer
286 views

Geocoding an Exploded Custom Field Array

So, I'm having a little problem with crossing signals in WordPress between Google Maps' API and an exploded custom field. I want to be able to geocode an address that's been exploded from a custom ...
0
votes
1answer
2k views

Run W3 Total Cache Flush Function with Crontab [closed]

Ok. I'm really stumped on this one. Basically, I need to call a function for the Wordpress plugin W3 Total Cache as part of a cron job in crontab. I'd like to automatically clear the entire page ...
0
votes
1answer
134 views

Update some database fields when post is saved

I have a class that will count the Lines of Code, Source Lines of Code, and the Code disk space used. I would like to save these values into the database so that these values can be calculated only ...
0
votes
2answers
1k views

Conditional Statement - check if post has an attachment image

I'm working on a conditional statement (in a loop) that looks for a featured image then grabs a default image if there is none, which I have figured out. But, I also wanted a way to pull the first ...
5
votes
1answer
2k views

How display widget by id

I fetched widget id this way: $the_sidebars = wp_get_sidebars_widgets(); print_r( $the_sidebars['sidebar-1'] ); It shows: Array ( [0] => recent-posts-2 [1] => recent-comments-2 [2] ...
4
votes
2answers
815 views

Build a content and excerpt grid loop with paging and options for # of posts

What I'd like to do: on index.php, a loop that shows a selectable number of full posts using the_content and then below that shows a selectable number (the number of posts can be hardcoded in the ...
4
votes
1answer
1k views

Is there a way to parse shortcodes in PHP?

Many plugins don't provide a documented way to access their functions from within PHP (e.g. when building a custom theme), but only shortcodes to insert in posts. Is there a standard way of executing ...
3
votes
1answer
465 views

Hide custom image sizes from media library

I want to hide a few custom image sizes from the media uploader: The following code (posted here) works only for the default image sizes: function remove_image_sizes($sizes) { ...
2
votes
2answers
105 views

How to order WP_User_Query results to match the order of an array of user IDs?

I'm using WP_User_Query to get a list of users from my database. I'm showing specific users only via use of the include parameter. For example: $args = array( 'include' => array( 1, 3, 5, 99, ...
2
votes
1answer
36 views

How can I modify the permalink via a filter?

I would like to make a change to the URL's in my href attribute across my while site when the_permalink is called. For example: <h2><a href="<?php the_permalink()?>" Can I use my ...
2
votes
0answers
3k views

How to get Woocommerce Variation ID? [closed]

I am trying to create some additional functionality on my Woocommerce backend where I add a custom field to the variations section of backend of Woocommerce. However I cannot for the life of me ...
2
votes
2answers
641 views

If in parent category

I have this structure Category > Subcategory > Post I´m trying to display some content if the user it´s on a specific category, or in it´s subcategory or post. I´m using this code but it only works ...
2
votes
1answer
1k views

wp_customize_image_control default value

I am trying to create a custom theme using Wordpress 3.4's customization options. I would like to create an option to change the theme's logo, but I would like to also display a default logo image. ...
2
votes
1answer
1k views

Bulk Image upload and one image for each post?

I have around 3000 photos, want to upload on WordPress. Is there any way to bulk upload all the photos as one image for each post ?
1
vote
0answers
84 views

How to resize image on client-side before upload?

I've been using Plupload to resize images on the client side before uploading them to the server. I've implemented a front-end form which lets the user select a file from their computer and submit it. ...
1
vote
1answer
65 views

Activate different theme for temporary preview

I wanted that when i access my site with specific parameter, my site used a different theme at that moment (only temporarily, to show only to me as a preview). I want it for test purposes. Is there ...
1
vote
1answer
208 views

Saving Plugin settings to the database

I'm not a complete novice with php or wordpress but am wanting to approach this problem the most efficient way so believe asking here will help. I've got a plugin that randomly generates a quote - ...
1
vote
1answer
190 views

Execute a shortcode when clicking on a image

I asked this in stackovorflow under javascript and was informed not possible so I trying here I have a shortcode for a opt-in form and I want it to pop up when a image is clicked I tried the ...
1
vote
2answers
209 views

How to change featured content to a different tag in Wordpress Twenty Fourteen?

In twenty fourteen theme, we’d like to know how to change the features content tag. Currently it’s set as featured. Now, we would like to know how to code this for different page templates. We ...
1
vote
2answers
489 views

How to turn off redirection from 'domain.com/login' to 'domain.com/wp-login.php'

I want to install something different than wordpress under 'mydomain.com/login', but WordPress automatically redirecting this link '/login' to '/wp-login.php'. Where can I turn off this redirection?
1
vote
1answer
295 views

Is it possible to get a theme customizer setting from wp.customize using jquery?

I am wondering if it is possible to directly interop with the wp.customize api to get a value of a theme customizer setting. The way I am doing it now is using ajax to get a response from a php ...
1
vote
1answer
57 views

Change Width of Featured Image Thumbnail on Add/Edit Post Page

Does anyone know of a way to change the width of the featured image on the edit post/add post page? I want to make it 50px wide. I'm not talking about the front page of the website, but the back end ...
1
vote
2answers
776 views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
1
vote
1answer
127 views

Wordpress PHP plugin - Settings page error

Writing a PHP plugin for Wordpress. It was an external PHP script. But now I'm having a problem. When I click submit on the page it redirects saying there are no permissions to go to that page. Edit: ...
1
vote
1answer
700 views

Conditional statement for parent, child and grandchild pages

I'm trying to figure out how to set up a conditional statement to check if the parent, child or grandchild is being displayed. This is what I've got so far: <?php if ( is_page( 'about' ) || '29' ...
1
vote
1answer
1k views

Wp favorite posts get user favorites in profile using buddypress [closed]

Im currently encountering a problem i display user wp favorites posts fine, but the issue is i wont display them, once users are logged out it says " no posts have been made" while each user has ...
1
vote
1answer
117 views

Remove class that has been added by parent theme

My parent theme generates the following class in body: style-cupcake. I don't want that. The best way to get rid of this is by adding my own functions in a functions.php file in my child theme, right? ...
1
vote
2answers
3k views

Limit the_excerpt with max of x characters

What I'm trying to do: I want to display the_excerpt, but I have a maximum of x characters the_excerpt may use, but I don't want to display a couple of characters of a word, only whole words. Some ...