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

learn more… | top users | synonyms (1)

0
votes
2answers
399 views

how to remove sidebar from particular one page

I am writing this code in page.php for removing the sidebar in one page <?php if (is_page('x')) : ?> <?php else : ?> <?php get_sidebar(); ?> <?php endif; ?> ... where "x" is ...
0
votes
1answer
93 views

How do I custom code the start page?

I'm pretty experienced in development in general, and also did some PHP coding to generate hmtl pages. I've also got a running WordPress blog with a number of posts. As a start, I want to "generate" ...
0
votes
1answer
84 views

How to call custom function outside from the admin page?

I've created a function but i have some problems with it... echo get_option( 'my_function', 'custom_logo' ); I try to use this in my code but it returns me an array not a string. When i use echo ...
0
votes
0answers
204 views

Using Select HTML in Bootstrap Popovers

I want to be be able to utilize a select few HTML tags in a Bootstrap popover. I know that I could include the option HTML = true in the settings, but this would leave me exposed to an XSS attack ...
0
votes
0answers
153 views

Postal address auto-complete on profile page

Is it possible to have an address auto-complete function (Where you enter your house number and post code and it automatically populates the address fields for you) within the Wordpress user profile ...
0
votes
2answers
38 views

How to modify the default feed via a function

I am trying to add a functionality to the default wordpress feed. The problem is i managed to do this modifying the rss feed php file. The problem number two that i have in mind is when wp gets an ...
1
vote
1answer
103 views

wp_kses and magic quotes

In the wp_kses codex page it says: You have to remove any slashes from PHP's magic quotes before you call this function. I am new(ish) to PHP and I wiki'd Magic Quotes and it was apparently ...
0
votes
2answers
2k views

Using file_exists to check file in Uploads

Context: For a site's images used in a particular section, each post relies on a base name put into meta data, which then is used with automatic extensions to generate large images, gallery thumbnail ...
-1
votes
0answers
83 views

How to force wordpress custom slider text to be static? [closed]

I have created my own customized slider plugin for wordpress and it is well created with all the features. But now i want to do that 'title' and 'description' displaying with each image should remain ...
0
votes
1answer
125 views

How to callback custom field text

I have a plugin where the user can click a button to feature a post. I added a text field but i want the text field to call back whatever is posted in it Here is how it looks now ...
1
vote
1answer
397 views

Showing user ID on user main page from screen options

On the user main page in the screen options, you have some choices for displaying user information e.g.. e-mail, role, posts etc.. Is there a way to be able to display the user's unique ID?
2
votes
2answers
141 views

Unable to set right time in admin and frontend template

When I run a simple php file called test.php (placed in the root of the wp installation) that contains something like that: <?php echo date('H:i:s'); ?> The result is right: 15:30:00 and the ...
0
votes
1answer
204 views

WP Query conflict on tag.php and category.php template

My WP_query in the header menu fails to pull any posts on tag and category pages only. Error occurs even with the Loop removed from those template pages. The menu in the header lists the parents. ...
3
votes
1answer
3k views

Ajax Load More Posts in Category Page

I am developing a theme where I need to load more posts with ajax. Currently, when I click load more on the category pages, all the posts are loading. The category.php looks like this : ` ...
2
votes
1answer
80 views

Why do filters/actions require an argument count?

I was just looking at plugin.php trying to answer the above question and I couldn't work it out. The actual code that calls filters is this: do { foreach( (array) current($wp_filter[$tag]) as ...
1
vote
1answer
675 views

Specified file failed upload test. wp_upload_handle

So I managed to write a peice of code that allows me to upload a zip file, im not even sure where it gets uploaded too, and I am doing it on my localhost with apache in control (www-data). the code is ...
1
vote
2answers
767 views

Get Wordpress Category ID from a URL string

How can you get the category ID of "category-name" from a nice URL (e.g. http://www.example.com/category/category-name/)? I need to retrieve the category ID from a URL of wordpress because this ...
0
votes
0answers
53 views

Getting recent posts corresponding to category items in custom menu

I'm trying to create a tabbed navigation, each tab containing 5 recent post excerpts of category items that are listed in a custom menu. I'm planning to load all these posts at once and put each ...
0
votes
1answer
67 views

Search through documents folder

Does anyone know why the following returns nothing? <?php $dir = get_bloginfo('template_directory') . "/documents/*"; foreach(glob($dir) as $file) { echo $file; } ?> I ...
0
votes
0answers
17 views

embedding php in javascript to switch out image in child theme [duplicate]

I am trying to embed a some php in my javascript to switch out images... $(document).ready(function() { $('.small-port-images a:nth-child(3)').click(function() { $('.large-port-image ...
1
vote
2answers
405 views

Sum custom field values of particular taxonomy

I need to sum custom field values of a custom post type with a particular taxonomy ONLY. For example... Custom Post Type: Computers Taxonomy: Laptops Custom Field: Quantity How can I get the ...
0
votes
0answers
36 views

Wordpress blog not loading articles

I have set up a static website with basic information pages such that all of the static pages fall into one level and in that directory there is directory "blog" which contains a Wordpress 3.5.1 ...
0
votes
1answer
3k views

Advanced Custom Fields: Post Object - Not returning data [closed]

I have a custom post type called "Training" with an archive page (archive-training.php). I have another custom post type called "Courses". I am using Advanced Custom Fields: Post Object to link ...
0
votes
1answer
997 views

Conditionally remove comments and post meta in functions.php

I'm new to Wordpress and am coming from the point and click world of Joomla! what was easy there now involves some solid php knowledge to replicate in Wordpress ;) I'm try to conditionally remove ...
0
votes
0answers
83 views

WP multisite network plugin fails to see classes loaded with spl autoload

I have a home-grown plugin that's a library of various classes/methods. Let's call it my_autoload. In WP single-site I've been using spl autoload to require() the classes as I have other plugins that ...
1
vote
1answer
358 views

User's total comment count excluding comments on their own posts

I'm currently working on a plugin that I hinted at here and so far I have managed to code everything, only missing one piece of the puzzle. This is how I get the total comment count for the ...
0
votes
1answer
126 views

How do I display offsite database info on my wordpress site?

I host some online games from my personal computer which the game saves information to my Mysql database. I would like to display live data (if possible) on my hosted Wordpress site. I know the ...
0
votes
4answers
2k views

Accessing post->ID outside of the loop for listing child pages

I'm wanting to list child pages of my current page in the sidebar of theme. However my sidebar (left side) is before the loop in the template and the post->ID won't return anything if it's before the ...
0
votes
1answer
40 views

Listing current pages subp page in list items in the sidebar

I'm wanting to list my current page's child pages as list items in the sidebar of my wordpress site. So far I've been referencing the http://codex.wordpress.org/Function_Reference/wp_list_pages I'm ...
0
votes
1answer
179 views

Simple tree display of WordPress menu

I want to display my wordpress menu in the form of a simple tree like this: >First menu item >sub-menu-1 >sub-sub-menu-1 >sub-menu-2 >sub-menu-3 >Second ...
0
votes
2answers
260 views

How to add PHP code snippet to all Post pages?

I wrote a short PHP snippet that I want to include on all past and future posts. I can't figure out which PHP file to add it into that'll affect the change to all and only Posts. Can someone point ...
0
votes
1answer
4k views

How To: Simple domPDF Example

Not quite sure if anyone here has used dompdf, but I'm in need of assistance. There's a plugin (post-pdf-export) that exports posts to PDF using dompdf. All I need to do is generate some html ...
0
votes
1answer
38 views

why is markup routinely placed in functions in wordpress?

Here is an exampple from a woothemes theme. I'm definetly not having a go at woothemes - they are a great theme provider with great standards and this sort of thing is fairly typical in themes. why? ...
0
votes
1answer
131 views

Snapshot Theme from WooThemes — empty 'alt' attribute

I´m using Snapshot theme from WooThemes. The code which resizes (width and height and size in kb), and shows the images (an 'a' tag, wrapping an 'img' tag) is this one: <?php if ( ...
0
votes
1answer
75 views

Styling the second sidebar

Ok so i added a second sidebar to my site, only problem is styling the widgets. here is the code i am using in my functions.php file // Widgets plugin: intializes the plugin after the widgets above ...
0
votes
1answer
70 views

3 domains, 1 wordpress install, redirecting and changing domains on live site

UPDATED & SIMPLIFIED: I have one Wordpress install at Host #1 with a domain (Domain-A) at Host #2. Domain-A was used for the WP install. I have Domain-B & Domain-C at Host #3. I need ...
0
votes
1answer
75 views

Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts

I use WyPiekacz to set various conditions for authors when creating posts, for example checking if the post has a featured image or how many tags that are being used. It works fine. However, these ...
1
vote
2answers
85 views

Where do posts get the sidebar from?

I'm trying to add an if statement on the sidebars that are displays in POSTS. I want posts to show a specific sidebar if it's in category x and display a different sidebar if it's not in category x. ...
0
votes
2answers
142 views

making php value numeric

I used some of this code from this page on Stack Overflow: Using wp_query is it possible to orderby taxonomy? It's about the function to be able to sort a query by a taxonomy value. Although it works ...
0
votes
1answer
1k views

How to send “Location” header on plugin form submit event?

How to redirect to specified page after form was submitted? Warning: Cannot modify header information - headers already sent by (output started at wordpress\wp-admin\menu-header.php:94) in ...
0
votes
1answer
30 views

Photos do not show on SEO platform built into a wordpress plugin

I’m building an SEO application. I built a plugin from the folder with the application. So, the folder is called body_call and inside has the body.php, the index.php (in which I placed the plugin ...
0
votes
1answer
345 views

Form Security: nonce vs. jQuery

I am trying to create a methodology for submitting forms on my WordPress site. In the past, I have used WordPress nonces in order to secure form submission, but I like the idea of using jQuery to ...
1
vote
1answer
3k views

How to access function from outside of a class within this class in WP plugin?

I am developing a WP plugin called e.g. DD_Awesome_Plugin and this is my code so far (simplified version without additional code logic within class functions): class DD_Awesome_PLugin { public ...
0
votes
2answers
977 views

Multiple pages on one with different HTML

I am a bit confused on how this may be achieved. I have a website that I have coded already with static HTML/CSS and I am trying to incorporate it into wordpress. The challenge though is that the ...
1
vote
2answers
2k views

Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page

I am working with custom post types and I had trouble with the nav menu not getting the .current-menu-item on my custom post archive page menu item. In fact, when I was on that page or any of the ...
-1
votes
1answer
4k views

Eliminate duplicates in a foreach loop [closed]

I've created a filter for my search results that allows people to filter user searches based on their State from their profile. The problem I am having is that there are duplicate states showing in ...
0
votes
1answer
116 views

Replacing WordPress Icons (menu,icons32, etc)?

I want to replace wordpress admin sprites. I recreated the images and looked answrs for icon replacement using jquery and simply with CSS BUT what about ones link icons32-2x.png where I can't find the ...
0
votes
1answer
33 views

Wordpress comments - delimiter “/” not found

Im using wordpress comments as a "chat". Not real time chat its more like comments with more flow. But when 4-5 or more members using coments at the same time i get this message: Not sure why this ...
0
votes
1answer
435 views

Fatal error: Cannot redeclare comment_theme()

I have this wordpress site build up. In the blog section my post is getting repeated which I do not want how can I get rid of this situation Use this link: ...
0
votes
1answer
28 views

Covert Wordpress Blogname into JQuery

Here is the blogname in php <?php $blog_title = get_bloginfo('name'); ?> I want to convert it to javascript. The file I want the blog name is in a .js file so I cant create the variable with ...