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

learn more… | top users | synonyms (1)

0
votes
1answer
103 views

get comment data using comment id

I am using the get_comments() function which works well if I give it any array of parameters except if I give the following array: $defaults = array('ID' => $comment_id); ...
0
votes
2answers
152 views

count number of user comments with a specific comment meta value

I am using the code below to count the number of comments by a certain user: global $wpdb; $count = $wpdb->get_var( 'SELECT COUNT( comment_id ) FROM '. $wpdb->comments .' ...
1
vote
2answers
2k views

Woocommerce -How to set product regular price default

I am using woocommerce at work for equipment requests, therefore all products I will create will need to be £0. Is it possible to set a default value of 0 for the regular price field on the add ...
0
votes
1answer
375 views

meta box not display data input in the textarea

I've had multiple errors with this metabox, first I thought Id fixed a undefined index error with the code below but now that doesn't appear my metabox doesn't save any data. code before the error: ...
0
votes
1answer
73 views

creating a second image attachment template?

Hi i am trying to create a second image attachment template. I have one, but I have created another. In the second one I want the attachments that are under a certain category of a post to have a ...
0
votes
1answer
144 views

Post Title Not showing up

Hi i'm using this code to call post from a certain category <?php $queryObject = new Wp_Query( array( 'posts_per_page' => 3, 'post_type' => array('post'), ...
-2
votes
1answer
94 views

metabox displaying on incorrect page

I've got two different functions that output different metabox's one is for the pages and the other is for just the post. For some reason the one I created for posts overwrites the one on pages and ...
-1
votes
1answer
243 views

Options.php loop won't show!

I'm creating an options panel for a theme on my localhost that's stored within the options.php file. My options panel will have two main loops. The first is to list the different sections and the ...
0
votes
2answers
442 views

Pagenavi pagination via wp-query in functions.php showing same content for each page

I've recently had a lot of help creating an upcoming events list (see here Showing upcoming events including todays event - StackOverflow), as a result my pagination using wp_pagenavi() is broken. At ...
0
votes
1answer
70 views

Trying to change image funtion from enlarge image to redirect to amazon website

So im making an amazon affiliate website. the theme im using (ebuy) enlarges the image when you click on it. I'd rather just have the image take you strait to amazon. i went poking around in the ...
0
votes
0answers
73 views

syntax error unexpected '}' at 364 line

I am getting this error on my website and am not able to access admin dashboard. The error occurs when I am a new theme on my website. Can you please help me to find this error. Parse error: ...
0
votes
1answer
475 views

Post meta select input, if statement

I have created a meta box with a select input (drop down menu). It has a few values and I want to display different content depends on which value the user selects. I am just unsure how to display ...
0
votes
1answer
358 views

How To Pass Array To get_the_category_by_ID() and Get An Array Back?

I am trying to pass an array of category IDs to get_category_by_ID() in order to get an array of category names back. Since I'm still trying to get this to work I'm just using var_dump() on the ...
1
vote
0answers
91 views

Checkbox doesn't stay checked, conten

I'm using the morefields plugin to create textfields and checkboxes in the dashboard. For a test I have first created a checkbox on 'pages' if it was checked, the frontend showed the text ...
1
vote
0answers
480 views

How can I save a multiple select array with the settings API for a plug-in options page?

I'm thinking this may be more of a problem with my PHP rather than my use of the settings API, but I can't seem to get Wordpress to save an array of data for a multi-select box. The multi-select box ...
0
votes
1answer
93 views

Clickable image link sends people to wrong URL

On my website www.wilsonstransportation.com, on the header of our custome theme page, we have a "Get a Quote" image on the right hand side. When you click it, it is taking people to ...
1
vote
1answer
741 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' ...
0
votes
1answer
323 views

advanced custom fields: repeater field within conditional statement [closed]

I'm trying to figure out if it's possible to have a custom field within a conditional statement. e.g— if ( is_page( 'about' ) || '29' == $post->post_parent ) { //custom field goes ...
0
votes
1answer
243 views

Prevent multiple counts by same user - WP PostViews plugin

I am using WP Post Views plugin to display the post number of views. To do so, I use: <?php if(function_exists('the_views')) { the_views(); } ?> The problem is: The plugin increments the ...
0
votes
2answers
43 views

conditional statement expressing that current user didn't logout (is still in the same login session)?

Thank you in advance for your time. I want to perform the following conditonal if: if (current user didnt log out and is in the same login session ) { Do_something; } How to express it using ...
1
vote
1answer
1k views

How to get Poster (thumbnail) Image of Video

I'm getting all videos using the function below and it's working fine. Now I want to get the videos Poster Image (Thumbnail Image) from that video. How can I get the video Image as thumbnail? I've ...
1
vote
0answers
67 views

Help with .htaccess and Login with Subfolders

I know this question has been asked many times, but I still not sure whether I have this correct. I am trying to make it so that my login page is here: www.url.com/login My WordPress installation ...
0
votes
1answer
41 views

Wordpress Options Page Theory Question

I created an options page and it is functioning perfectly, but I am not sure I understand how it functions. It's cool I got it to work but I was hoping someone could help explain why it works. Here ...
0
votes
1answer
250 views

Using a nonce in a Custom Login Form

I am trying to create my own login form for WordPress using wp-login.php as a template. In the form that is used to collect login information from the user (lines 680 through 703 of wp-login.php), ...
0
votes
0answers
48 views

get_post_meta no longer working

I am trying to use get_post_meta to return a value from the post meta, it was working completely fine then suddenly stopped working. I've tried and checked everything and i cannot seem to get it ...
0
votes
1answer
198 views

How to add videos on my home page slider?

How would you recommend adding videos to my website's home page slideshow, here is the php code that creates the slideshow: <?php global $gpp; ?> <div class="app"> <div ...
-5
votes
1answer
97 views

Custom Fields within custom post type

Am newbie. I have a custom post type 'dogs' and i want just 2 custom fields in this type. A pic on the left and text on the right - repeatable fields. Anyone know how to do this? I've no clue of php ...
1
vote
1answer
570 views

Insert After Second Paragraph Without <P> Tag?

I use a code like the one shown below to insert ads after the first paragraph. The problem is that this code requires the content to be displayed within paragraph tags and I would like to use this ...
0
votes
1answer
48 views

Advanced Taxonomy query, with 3 post types

I'm been trying to figure out how to do this for a few hours now and Have final given in to asking for help. I've got 3 custom post types that I need to query for a term called home which is inside a ...
0
votes
1answer
34 views

Difference in Get Variable Location

I have noticed that in some instances in WordPress (such as in my custom post types), GET variables appear as following in the URL: www.url.com/events/cool-event?action=edit&message=1 However, ...
0
votes
3answers
694 views

Custom Widget outputs the input but doesn't save anything inside the textarea

I've been working on my first widget, Everything works perfectly except it doesn't save anything I add to the textarea box. It will output the input on the website however. From research I think its ...
0
votes
1answer
631 views

How to Explode a Textarea Field and Echo each line separately, wrapped with HTML

Need to take an advanced custom field textarea and display it in my template by breaking out each line separately. I want to wrap each line of the textarea with HTML, like an <li>. I've tried ...
-1
votes
2answers
249 views

Wrapping the_content() in Schema articleBody tag? [closed]

I am trying to put the_content() inside <meta itemprop="articleBody" content="(content here)">. But if I just put <?php the_content() ?> in there, it doesn't work, image goes, structure ...
1
vote
1answer
65 views

How do I limit the number of forms a user can create in gravity forms?

I've been looking at Gravity Forms, and whilst it's a great plugin, it's missing some features. I really want the ability to limit how many forms can be created by a role: Administrator - Unlimited ...
1
vote
2answers
2k views

If Meta Checkbox is checked, do something?

I created a custom checkbox that when I check, I wish it to display slightly different content (specially special css styling). For some reason it is not functioning properly. In my functions: ...
0
votes
1answer
396 views

wpdb prepare insert table doesn't work

I followed the introduction to use prepare to insert some data to the table. The code is like this: $wpdb->query( $wpdb->prepare( "INSERT INTO ...
0
votes
0answers
52 views

Highlight posts currently being edited on multiple editor site?

I have a custom page that uses the Cleverness To-Do List plugin to display multiple posts on a page. My site has multiple editors, and if a post is currently being edited on the custom page (not the ...
0
votes
0answers
615 views

Woocommerce purchase note?

I think i am missing something glaringly obvious here: I am trying to include the pruchase note in the customer-completed-order.php so the customer recives the note along with the pruchase ...
0
votes
1answer
70 views

Keeps asking Connection Information upon update to 3.5.1 (but not for plugins?)

for starters, I am using WordPress on a live server in which I can only login using sftp with an ssh key. I want to install and upgrade to the latest version of WordPress (currently at 3.4.2, but ...
0
votes
1answer
53 views

select a single val though a table in wordpress

The table is like this: category_id category_name category_parent_name I would like to get category_id by using category_name. I searched online, and the code is like below: $ad_cat is the ...
0
votes
1answer
57 views

How to add equivalent of php include to one page (as plugin?)

I'm new to Wordpress. I have a website that I coded myself. One of the pages has PHP functions that take a google calendar feed (with hard-coded login info) and displays it as needed. I am now ...
0
votes
1answer
71 views

How to add 3 weeks to the_time() function

I have a WordPress blog where I need to display an image on each post only for 3 weeks. This means that after 3 weeks have passed, since each post was published, the image will disappear. First, I ...
0
votes
1answer
259 views

How to display custom post type only on a certain page?

I have created a custom post type called 'project'. But how do I get the custom post types to display only on my main template? It's a one page website and I don't want it to direct the visitor to a ...
0
votes
1answer
88 views

MySQL database migration to WordPress

I have a MySQL database established for a web application I have been working on in a non WordPress database. This database has many tables with pre-populated rows for foreign keys etc. which took a ...
0
votes
2answers
36 views

Dark Bar at the top of wordpress page can't be seen?

I am new to wordpress and created a website as shown in the picture bellow. My webpage used to have a black bar at the top, which allowed me to insert "New Posts". (area shown in red circle). But this ...
0
votes
1answer
48 views

conditional: if is page, and all subpages

What I'm currently trying to achieve is displaying certain menus on certain pages using one template and conditional statements, like so: if (is_page('donate')){ wp_nav_menu(array( 'menu' ...
0
votes
1answer
773 views

Trouble Installing Wordpress Get PHP Not Running Answer

I have seen this topic discussed several places on the internet, both in the Wordpress official forums and on individuals' blogs. Despite having worked through some of the suggestions, I am still ...
0
votes
1answer
259 views

wp nav menu: show submenu below li item

I'm trying to figure out if it's possible to show the submenu's outside of the relevant li tag. For example, this php: wp_nav_menu(array( 'menu' => 'side', 'container' => false, ...
0
votes
1answer
1k views

Query multiple custom post types in single loop

I'm aware there are several other posts that cover similar ground to what I'm about to ask. I have three custom post types running, in addition to 'posts'. I want to run a loop that pulls all posts ...
0
votes
1answer
5k views

wp nav menu: add attributes to menu items [duplicate]

I'm trying to figure out if it's possible to attach an attribute to a wp nav menu item. To demonstrate, this php: <?php wp_nav_menu(array( 'menu' => 'main', 'container' => ...