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

learn more… | top users | synonyms (1)

0
votes
2answers
4k 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
209 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
501 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 here....
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
472 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
1k 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
692 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 > ...
0
votes
2answers
3k views

Display all posts in current category

I am looking to create a behavior as shown in the following link: http://www.javaexperience.com/java-role-of-serialversionuid-in-serialization/ Here all posts from the same category are being ...
1
vote
2answers
1k views

Displaying custom post type on front page

I added a new custom post type to my Wordpress theme but it refuses to show on the homepage. I tried setting <?php query_posts( array( 'post_type' => array('post', 'reviews') ) );?> but ...
-1
votes
1answer
150 views

Comment section not appearing on posts with no comments

Recently I bought a theme at Themeforest called Ravage for my writing-blog. Yesterday I found out that its not showing the "pretty" comments-section (which has a stylish newsletter sign up form and ...
0
votes
2answers
166 views

Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )

I have updated my permalink structure to /archive/%post_id%, but if someone uses a URL like /archive/456857 instead of the full URL of /blog-test, WordPress shows the post without giving a 301 to the ...
4
votes
2answers
1k views

Why can I not use setup_postdata($post) in the sidebar?

I have created a function that takes one parameter - post type, and will output each posts with some html and title, content etc within that. However, I want to be able to use functions associated ...
12
votes
1answer
304 views

Why isn't WordPress part of Framework Interop Group?

Are there any technical reasons that prevent WP to be part of Framework Interop Group?
1
vote
3answers
884 views

Wordpress widget/sidebar dividers?

I have a widget sidebar, but I'd like dividers between them. I can achieve this in CSS using boring borders, but I have a png image I'd rather use instead. Is there a way to insert a divider after ...
1
vote
0answers
98 views

How can integrate zend module with wordpress admin dashbord

I want to add zend application into wordpress admin dashbord with a menu link.I have copy all the application folder files from zend application and create a plugin in wordpress,its working when we ...
1
vote
1answer
222 views

Logged in user ID as post ID

Is there a way to automatically insert the current user ID as the post category name or maybe have WordPress display only the post with a category name that matches the current logged user ID? <?...
0
votes
1answer
143 views

Page downloads as file in Chrome

I'm looking to see if I could get pointers in where to look to solve this issue. Issue In Chrome, viewing the blog http://www.bitesizeirishgaelic.com/blog/ in Chrome v21, the page downloads as a ...
3
votes
1answer
344 views

Restrict users from editing post based on the age of the post

How can I restrict users (based on Capabilities) from editing their published posts after a custom amount of time. For instance, a user that can publish_posts (authors) can not edit a their post if ...
1
vote
1answer
89 views

Must I download entire WP directory for each separate instance/website that uses WP?

I'm no noob when it comes to website design or development. And am quite savvy with JQuery, XHTML and PHP. However, I admit I am quite noob-ish when it comes to WP... I already have the WP directory (...
0
votes
1answer
49 views

Tables not showing divs and loop/php items

I know this is an absurd questions, as who uses tables anymore? I got handed this and just need to make it work really. I don't know anything about tables so it's been a learning experience. I ...
1
vote
1answer
520 views

How do I list the_tags() into HTML data-attribute

I'm new to wordpress and trying to make a theme. I'm using a jQuery filter script on a page of posts that filters the posts nested in an unordered list using the HTML data-attribute as a hook in the ...
0
votes
2answers
307 views

Using a string from a custom field within a link

I want to show the image only if there is info in the field. And the link around the image uses the info in the field. The mailto: field is coming up blank. So I'm guessing/hoping I'm doing something ...
0
votes
1answer
47 views

Meta boxes only displayed when editing normal (default wp post_type) posts

I've multiple meta boxes for my main/default post types. I also have multiple post_types where this meta boxes make no sense. Can you hint me on if/else function I would use on displaying meta boxes ...
1
vote
3answers
179 views

How can I hide Home in my menu in a specific page?

I want to how can I hide the home in the menu without setting show_home in functions.php to false, I just want to do is hide it in a specific page. How can I do this? I am using the Twenty-Eleven ...
5
votes
2answers
6k views

Most efficient way to add javascript file to specific post and/or pages?

I am wondering what the most efficient method is to add a javascript file specifically for a post and/or page. Here are a few solutions I came up with: Switch to HTML editing view and post your ...
1
vote
1answer
235 views

How do I translate this string - PHP syntax question

I need some help on how to correctly format this code snippet for translation: <?php next_post_link( '%link', __( '<span class="meta-nav">←</span> Nästa nyhet') ); ?> I've used ...
2
votes
2answers
3k views

Fatal error: Call to undefined method WP_Error::get_item_quantity()

I've implemented a way to show the Twitter feed without a plugin. It's worked for weeks(months even, on a different site), but is now giving me trouble. Here is the error: Fatal error: Call to ...
7
votes
2answers
4k 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 ...
5
votes
1answer
1k views

Hide php Notices in Dashboard

When I program a theme, I put WP-DEBUG on. Which ensure a proper PHP code. Sadly most Plugin developers keep using non existing vars : echo $args['title']; Notice: Undefined index: title in /wp-...
1
vote
1answer
204 views

Pass get_option value to an array [closed]

I want to pass get_option value to an array value. This the value that I want to pass to the array. <?php echo stripslashes(get_option('a')); ?> and this is what I am trying to do. <?php $...
0
votes
1answer
50 views

displaying the categories post

I have this php code below for displaying the post from the specific categories. <ul id="sliderx"> <?php query_posts('category_name=slideshow&showposts=10'); while (have_posts()) : ...
0
votes
2answers
835 views

Categories from front-end, checkbox selection doesn't work

I'm using the plugin Post from site, which sets up a WP front end writer. I changed some line of code because I need to select categories with checkboxes and not with a multiple select (as it was ...
7
votes
4answers
26k views

Get page content using slug

I'm trying to get page content when I only know the slug string. Is there a function for this, or an easy way to do this or is this a case of doing it via SQL? Thanks very much
0
votes
1answer
54 views

include <p> content within conditional statement?

I have a gallery page wherein there are multiple individual galleries/sub-pages. I handle this function by using- <?php if( is_page( 39 ) ) { echo do_shortcode('[nggallery id=1]'); ...
0
votes
1answer
363 views

How to keep track of when a vote is cast?

I have setup a great voting system on my website, but since I want to sort the top rated posts by week, month and alltime...I now need to able able to keep track of when a vote has been cast. Could ...
0
votes
1answer
6k views

Add a Second Menu to a theme that only support 1 menu

I am no programmer but I can usually work stuff like this out when I read the code. I have a theme called Infinity which only supports 1 menu. I know how to do CSS etc but I can't find how I would a ...
1
vote
1answer
1k views

How to target with css, admin elements according to user role level?

I am using plugins "Capability Manager Enhanced" and "Adminimize". Between these two I have been able to do much of what I want to do. There are still some elements I need to hide and have been able ...
-1
votes
1answer
934 views

PHP-Code inside Href-Tag

I have include PHP-Code inside a href-tag – and it doesn’t work! <?php $image = get_post_meta($post->ID, 'image_medium', true); if ( $image != '' ) {?> <a href="<?php ...
-1
votes
1answer
256 views

Null value given when confirming email's

Fixed the problem by adding if ( 'email' == $type || 'email2' == $type ) { to the top of the snippet below and changing the first elseif to a if statment I have created a WordPress register form on ...
0
votes
2answers
517 views

trouble with page_id & highlighting current page

I'm using the below code to highlight the page name/gallery shown when the corresponding link is clicked on. My challenge is that regardless of what link I click, only the very first link(page_id=24/...
0
votes
1answer
235 views

What does $2$3 mean? [closed]

Came across a line in some Wordpress code I am modifying and just flat out don't know what the $2.$3 is? Maybe it's a PHP thing that I just never learned? Can anyone explain this to me? Here's the ...
0
votes
1answer
52 views

How can I fix this, i get an error 404 when i acess the second page of post-type

How can I fix this, i get an error 404 when i acess the second page of post-type www.site.com/clipuri/2012/ www.site.com/clipuri/2012/page/2/ register_post_type('clip', array( 'label' => 'Clip'...
2
votes
3answers
8k views

woocommerce and is_user_logged_in() if not redirect to homepage

I am currently using woocommerce and would like to redirect none logged in users to the home page, however i am having a little trouble determining where i should implements this I have done research ...
0
votes
1answer
324 views

Accessing Global Vars & Functions in custom php page

I have created a php page called "test.php" and uploaded this file to the root folder of my wordpress installation. This file contains only this: <?php if ( is_user_logged_in() ) { blah..... } ?&...
1
vote
0answers
141 views

check if comment submitted was successful

I want to use php to understand if comment submission was successful. Is there any get/post data I can use to make if function for this?
0
votes
1answer
278 views

How do I filter a custom post type loop by a field?

OK, very simple task, I'm just not good at PHP. I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - http://www....
5
votes
2answers
1k views

Adding a custom image upload size and making it selected by default?

How can I add a custom image upload size with a width of 550px and make it selected by default in the Add Media page? Currently, there are 4 sizes available: Thumbnail, Medium, Large and Full Size. ...
1
vote
2answers
531 views

How to create and work with custom data / tables (i.e., for arbitrary data)?

Getting started on Wordpress just today. I noticed that Wordpress created tables in a mySql database (with name *.wrdp1) when I first set it up. These tables cover comments, posts, users, and some ...
-1
votes
1answer
408 views

How do I create a single Wordpress page that will use PHP to include different HTML files based on a vaule in the URL?

I have used PHP on a page to include HTML files on a page such as: <?php require("http://www.mysite.edu/_sports/static/season_box.html"); ?> This works well for including a single file that ...