WordPress is a free and open source blogging tool and a content-management system (CMS) based on PHP and MySQL.

learn more… | top users | synonyms

10
votes
2answers
183 views

First attempt - Wordpress PHP Settings API wrapper

I've been working on what is essentially my first proper attempt at making a useful PHP wrapper class for the Wordpress Settings API. It works great so far and I plan to add more methods as I go so ...
7
votes
2answers
88 views

Trim string of words based on character count

I needed a simple way to trim a string of words based on a max character count. I also needed to cut in-between words. Using WordPress, here is what I came up with, but I feel like it could be more ...
6
votes
3answers
202 views

First Wordpress plugin for saving a post

This is my first Wordpress plugin. I would love some input from the WP/PHP/JavaScript gurus out there. It's a simple plugin that saves a post using ctrl-Q and opens a preview in a new or current ...
5
votes
3answers
97 views

Evaluate a Contact Form CSS

I am a total novice to web development, but I am trying to be a WordPress developer and have been actively at it for some weeks now. All self-taught with the world's best tool as my aid: the internet. ...
5
votes
2answers
514 views

modify custom loops to improve readability and efficiency for Wordpress?

The following code retrieve custom post types with their custom taxonomy. I'm just a beginner in PHP and I would like to know tips in order to improve readability and perhaps efficiency. home.php: ...
5
votes
1answer
109 views

Is this a good WP Post Type template script?

I have created this class for my WP theme. It allows you to create templates for a meta box which relates directly to a custom frontend template to have better control of the content displayed on the ...
4
votes
2answers
203 views

Confusing and weird indentation problems in this Wordpress file (single.php)

I think there are some confusing and weird indentation problems in this Wordpress file (single.php). Any suggestions to fix indenting and readability? ...
4
votes
0answers
155 views

How can I optimize this query to improve performance? [closed]

I'm building a wordpress website using advanced custom fields and the repeater plugin. I've managed to put this query together after re-organizing my data using the repeater plugin. The query below ...
3
votes
1answer
61 views

Social Share count

I am creating a social sharing counter plugin for my WordPress blog. I want to fetch the counts of number of likes, shares, Facebook comments (I am using Facebook comment box), twitter tweet counts ...
3
votes
1answer
263 views

WordPress Functions.php file

I am making a WordPress "framework" for myself. Looking at the functions.php file file, is there redundant or bad code that could be changed or some code that could be good to add? The functions.php ...
3
votes
1answer
94 views

Exporting data in a WordPress widget

I have some custom tables in a Wordpress database that I need to export to CSV. I created a dashboard widget to help with this based on some assistance given to me on on one of my SO questions. It ...
3
votes
0answers
31 views

Plugin that grabs the coordinates of all the cities in our database

I have a plugin that grabs the coordinates of all the cities in our database working in WordPress here. ...
2
votes
3answers
130 views

Making PHP/WordPress code more efficient

I'm beginning with PHP programming and would appreciate a critique on my code and how I could make it more efficient, rather than repeating the if statements. What I'm basically doing is getting the ...
2
votes
1answer
44 views

DB security and efficiency in WordPress plugins

I recently wrote my first WordPress plugin, which was also my first PHP project. After I was done, I didn't care for the code at all, so I have spent the past couple of days refactoring it. I'm trying ...
2
votes
1answer
77 views

Wordpress filter post by metavalue

I am making a filter to get posts by status that are saved by post metavalue in a Wordpress plugin. It is a question and answer system, where the question and answer are post objects. ...
2
votes
1answer
250 views

simple theme options in array

I have created a wordpress theme options using array, and it is working. There are 5 type of input text,textarea,checkbox,select and upload. Kindly check this ...
2
votes
0answers
66 views

Automatic submenu

The goal here is to create a Top Level Menu that automatically pulls child pages without the need to manually add them to said menu. I didn't know any other way to accomplish this without a walker, of ...
2
votes
0answers
28 views

Is this the correct usage of filters in WordPress? [closed]

I am building a plugin and I'm getting doubts whether the code I am using is the correct way of doing things with regards to WordPress hooks and filters. The scenario is that the code at a particular ...
1
vote
2answers
68 views

How do I refactor this responsive background images code?

In my latest project I am using fullscreen background images for each page. I decided to write some code to fetch the different thumbnail sizes and then use it as a background for the appropriate ...
1
vote
1answer
91 views

Wordpress $wpdb->row Query Check

Looking at $wpdb class, I found get_row, and I am unsure if the function automatically prepares the query. I believe it does not ...
1
vote
0answers
245 views

jQuery/AJAX Plugin for WordPress and Foundation Reveal: How can I improve this code?

I figure that someone here probably knows a much better way to do this. I'm still figuring out AJAX and jQuery, so I consider that I still need to master quite a bit of knowledge. My function ...