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

learn more… | top users | synonyms (1)

0
votes
3answers
3k views

Show content if parent page has children

Using this piece of code you can show content depending if it's a child-page or not: <?php global $post; if ( is_page() && $post->post_parent ) : ?> This is a child-page. <?php ...
1
vote
2answers
97 views

Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?

I am using the following code to generate a JSON feed. I need to extract the excerpt from posts, but when I run get_the_excerpt() it takes 28 seconds (yes SECONDS!) to run on my local server versus ...
0
votes
1answer
308 views

JQuery prepend a function

I am trying to see where I went wrong with this code. I was trying to prepend the avatar and user meta above the admin menu. I get header already sent messages as well since the code is just right ...
1
vote
1answer
633 views

Adding a slider captcha to the comment system

QapTcha is a draggable jQuery captcha system. I have been trying to create a plugin to make it work on the Wordpress comment system. I found a plugin that is already doing this but it is outofdate and ...
0
votes
2answers
3k views

How to add a php custom page to Wordpress

I want to create a custom page for my Wordpress blog that will execute my php code in it, whilst remaining a part of the overall site css/theme/design. The php code will make use of 3rd party APIs ...
2
votes
2answers
850 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 ...
0
votes
3answers
818 views

How to display different widgets on specific pages, hide from other pages

I want to display a dynamic sidebar on all pages, and a different sidebar on the homepage. There are also particular pages where I don't want to display either of them. This code is not hiding the ...
0
votes
2answers
642 views

Bridging TinyMCE js and Wordpress PHP?

I'm updating my wordpress plugin to use a custom TinyMCE button. From inside the TinyMCE button javascript, I'd like to interact with wordpress data--ie set custom post options inside the plugin ...
0
votes
1answer
401 views

More gentle way to hook Wordpress custom url

I have written a plugin named foo, and I want when user typed url /hello and it will display the string world There is an existing psot[1] use the following code if ($_SERVER["REQUEST_URI"] == ...
0
votes
1answer
377 views

xmlrpc how to check for errors

I am trying to post to wordpress with XMLRPC using this tutorial:http://wp.tutsplus.com/tutorials/creative-coding/xml-rpc-in-wordpress/ the problem is that tutorial does not have any kind of check ...
-1
votes
2answers
255 views

Get URL from shortcode tag

I am running a wordpress site and I need the correct regex syntax to get a URL from some shortcode that is returned inside the_content(). When I use the_content(), it will return something like ...
2
votes
1answer
3k views

Check if post of title already exists

I'm writing a plugin that takes an xml feed and posts it into WordPress using wp-cron Everything is working dandy, except it keeps adding the same posts over again. So, I'm working on a system to ...
1
vote
3answers
4k views

WooCommerce - Fixed quantity of a product [closed]

I am trying to accomplish a thing on WooCommerce that I can not find any information about. It is like the following scenario: I sell screws and have 1500 in stock. I would like the customer to ...
1
vote
1answer
125 views

Why isn't admin_notices displaying my text? [Simple Plugin, Beginner]

Here is some code that is the result of four days of studying Wordpress and PHP. Unfortunately, it's not working the way it's supposed to. Nothing displays at the admin_notices bar. Originally, I ...
0
votes
3answers
4k views

Single.php back button to parent category

I want to add a back button that goes to the parent category of the actual single post that the user is viewing. How can I do that? <h2 class="link"><a ...
0
votes
2answers
2k views

Custom single.php files for different post formats

I have 3 custom post formats. One is for image, one for video, and, one for gallery besides the default post and they each have a view comments link on the bottom right corner at the end of the post. ...
0
votes
1answer
598 views

Loading a post's content, into a div outside the loop, when it's title is selected in a list

I am building a site in wordpress where at a certain part there is a container that has a list of post items (see it as a menu/sidebar), and an empty space where I will load content. When you click on ...
0
votes
1answer
182 views

Pulling sub-site content into specific pages

I'm working on a school website. The design calls for a collection of largely static pages, but for each class to have a blog which will be updated every few days. I know nothing about WordPress or ...
0
votes
1answer
338 views

Call plugin with php function

This plugin only works as widget. I need call this plugin with php function. How to modify this code ? <?php /* Plugin Name: AJAX Calendar Plugin URI: ...
0
votes
1answer
2k views

Set WordPress Default Template

I'm using the Options Framework Theme to put together my options page and would just like to know how would I set up/call the Default Template - for whichever one the user has selected. For example, ...
0
votes
1answer
189 views

Does WordPress cache get_user_meta() results?

If I call get_user_meta() to retrieve a value, does WordPress cache the value? If I call get_user_meta() to retrieve the same value, does WordPress have to query the database again or is it stored in ...
2
votes
2answers
1k views

Renaming wp-content folder dynamically

Is it possible to rename the wp-content folder dynamically? I am building a custom framework to use on themes and it would be nice to set it up where it does everything on its own. I am using this ...
1
vote
1answer
564 views

Limit the Excerpt field in WP-Admin in words

Is it possible to limit the Excerpt field on the post page in words? Note that I am aware that it's possible to echo the excerpt and limit it in words, but I want the field itself to limit the amount ...
0
votes
1answer
46 views

Wordpress create new <section> on site when a new page is added

I'm trying to create a single page wordpress theme. Whenever I add a new page, I want a new to be added to my Single page theme. I'm currently using this code: $pages = get_pages( array ( ...
0
votes
2answers
298 views

How do I define a lookup table that will work across all PHP elements of the template?

I'm using a lookup table to define a few things for the qTranslate plugin Table $trans_home = array('en' => 'Home','it' => 'Home','de' => 'Home','zh' => '首页','es' => 'Página de ...
4
votes
1answer
372 views

List latest posts in WP-Admin

I run a multiple author site and I have created a plugin in wp-admin where authors can connect and collaborate with each other. To enhance it, I want to display a list of latest posts, this list ...
0
votes
1answer
79 views

Cloning add_settings_field() with jQuery

Is it possible to setup one add_settings_field() in an options backend and then use jQuery clone function on the front end and be able to create multiples of whatever and save that in an array? I've ...
0
votes
1answer
283 views

Page Options Saving But Not Updating In Backend

I have created a custom options page for a slider that you can upload slides to. Everything works great except when trying to save the data. It will get saved and I can use it on the front end. But ...
2
votes
1answer
616 views

Rewriting search and pagination base

After trying for weeks now how to find a working solution I got rid of most of my functions and trials and just left the pagination function underneath in my functions.phh file: /** * Pagination ...
-1
votes
1answer
686 views

Adding Meta Tags to a Post using its Tags, Excerpt and content

I run a multiple author platform where I have added conditions that force authors to add tags to their post. To improve SEO, I would like to add Meta Tags to the posts. Ideally, with a light solution ...
1
vote
2answers
664 views

Reordering Buddy Press profile navigation [closed]

I am using this code to reorder the positions of the menu items for BuddyPress profile. I am using the xprofile (not sure if that makes a difference). Here is the code that I am trying to use: ...
0
votes
1answer
65 views

custom fields wordpress

I am trying to add a value assigned in the custom field by doing a post in these following steps: I make a new post, add a new custom field where i specify a name and a value. PHP I add the ...
4
votes
7answers
247 views

Plugin or mod for wordpress to make content publication SUPER easy

Well, im making a wordpress web page for my dad, a psychiatrist, who barely knows how to check his email. He wants to put content regulary but the actual admin interface of wordpress is way to complex ...
0
votes
3answers
622 views

Setting post thumbnail sizes in template file and functions.php

For my post I have a box for the post image and the size of the box is 214 x 73. I want the image to fit the width of the box and have it cropped at 73px height. This is what I have so far in my ...
1
vote
1answer
391 views

stats_get_csv (Wordpress Stats) to only display top posts (not pages)

I'm trying to get the first 10 posts based on page views through Wordpress Stats (now called Jetpack). I managed to get this code to work (approximately..) after digging for hours over the forums ...
-1
votes
1answer
230 views

Adding a content rating system

I run a multiple author site and the content is directed to various age groups. Instead of forcing the writer to manually note which age group the post is appropriate for, I want to add a content ...
0
votes
1answer
128 views

Submenu opened problem

I am trying to fix a problem with a submenu. I have coded (as you can see on jsfiddle: http://jsfiddle.net/8899x/87/ ) my horizontal menu and the submenu. I would like to leave the submenu opened when ...
2
votes
1answer
132 views

Bug in Stackoverflow styled badge system script

I have modified an old Stackoverflow inspired badge system script to work with the latest Wordpress version. You can view the code here (and please feel free to use it if you wish): ...
1
vote
2answers
124 views

I would like to have different styles for my posts based on the content of each post

Here is my wordpress theme to check out(its not completely finished): http://benlevywebdesign.com/wordpress/ This is my first time working with php/wordpress and making themes so keep that in mind. I ...
1
vote
2answers
1k views

Accessing site's root from themes folder

Having some troubles with a PHP script I am trying to build. I need to access the a file which is located in the root folder of my Wordpress install: wordpress-root/live-config.php Problem is, my ...
1
vote
3answers
435 views

Delete post revisions on post publish

Is it possible to delete post/page revisions from the database when a post/page is published? 11/05/12 Answer: See the plugin below by bueltge I want to do this on a site with 5,000 posts and ...
0
votes
1answer
188 views

Migrating site, only header shows

I have copied my file structure to a new server, and exported the relevant tables to an SQL file. I have imported the tables to the new database. When I visit the new URL, only the header of the ...
0
votes
2answers
3k views

Get custom post type categories to show up in menus

I'm wondering how it's possible to add custom post type categories as an option to add as a navigation menu item. What I have: $portfolio_args = array( 'labels' => array( 'name' => ...
0
votes
1answer
180 views

doubled content

I'm taking two templates and molding them into one that suits my needs. I'm getting this weird issue where things are repeating themselves just before the footer. Here's the code: <?php ...
1
vote
1answer
312 views

Echo URL of large version of Featured Image

I use this plugin to echo the URL of a post's featured image in the header: <?php /** Plugin Name: Post Thumbnail FB header */ function fb_header() { // Not on a single page or post? Stop ...
2
votes
1answer
2k views

API JSON Data in WordPress

On the Google developer API page, it talks briefly on retrieving a dynamic list of fonts using JSON/JavaScript. I was wondering how would I be able to pull the web fonts API into my Wordpress theme ...
1
vote
1answer
397 views

Date calculations from 2 custom fields

We are struggling to find a way to calculate a time difference between two dates saved as custom fields on WP. We are actually using two different plugins: a) Easy Content Types b) Advanced post ...
0
votes
1answer
46 views

Adding if statement to content for homepage

I have an if statement already in my loop to display content based on post type. I was wondering if there was a way that I could say to ignore that section if it is the front page/homepage. Here's a ...
4
votes
2answers
924 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 ...
5
votes
1answer
535 views

Decrease file size upload in Media

By default, I have a 2m limit of uploads. I want to decrease this number. I found out that this code: function custom_file_max_upload_size( $file ) { $size = $file['size']; if ( $size > ...