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

learn more… | top users | synonyms (1)

0
votes
1answer
117 views

PHP to Programatically delete a file

I am writing a plugin that allows the user to upload files to the upload directory of WordPress. I want them to be able to "uninstall" the files with the click of a button. When the user clicks the ...
0
votes
1answer
81 views

Show parent categories of the current category

this code returns the parent categories of the current category with links separated by '»': echo get_category_parents( $cat, true, ' » ' ); will output: Internet » Blogging » ...
0
votes
1answer
626 views

Post Thumbnail on Single (if elseif else)

I have the following news articles on the frontpage of a website I'm currently working on: For this I'll need to write two simple PHP if statements, which I've already done successfully, but on the ...
5
votes
1answer
106 views

Change the filename format of saved featured images

Does anyone know how I could change the way wordpress saves the featured image's additional image sizes? Right now I have the main image saving like so: test_builder_banner_2.jpg and for each ...
-1
votes
1answer
84 views

How to insert a variable into a query parameter?

I need to put a variable into query parameter. I have this situation: $variable = get_field(loop_category); $catquery = new WP_Query( 'category_name=***VARIABLE-HERE***'); ...
0
votes
1answer
103 views

Jquery and Sticky

I have a trouble with jquery and sticky in a div in my website. I have included jQuery core in my page, inside the tag "head": <script ...
0
votes
0answers
169 views

Working on fixing wp-front-end-editor, encountering undefined index

Scribu's Frond-End Editor plugin is brilliant, but throws some Strict errors in debug mode. Since I'm using the plugin on a project, I figured I'd fix the errors. (You can see my changes from the ...
0
votes
0answers
167 views

Selectbox Custom Post Type

I use a dropdownbox to show all custom types. On the archive page of the custom post type it works fine. If I put dropdownbox to another site, it doesn´t work anymore. The selectbox is empty. Any ...
0
votes
1answer
36 views

Blog only showing code

I would like to have some help. I host a wordpress blog in my raspberry pi running apache2, but when I browse the blog it only shows the code as you can see here http://lifeonpi.sytes.net/raspgrammer/ ...
2
votes
1answer
51 views

Edit category output

I am using the following to display all the categories from my custom post type. How can I edit it so instead of having the output of the categories in <ul><li> elements it has <a href ...
1
vote
0answers
53 views

Genesis framework comments broken?

I got a really weird problem. Im using a Child theme which using the Genesis framework. I was using Akismet plugin to stop the spammers and it was workin just fine. Recently i just made a comment by ...
0
votes
2answers
209 views

How can i give a download link to the thumbnail or featured image

I am using the code below to give users download the thumbnail image, as i have a wallpapers site: <a class="downloadbutton" href="<?php echo $src[0]; ?>" download="imageName">Download ...
0
votes
0answers
189 views

Self-added mysql column as custom fields value

I am trying to add a value from a column that I've added myself to the wp_posts table as a custom field. So right now there is a column called 'shares' which holds an int value and I want that int ...
0
votes
2answers
359 views

Get ID of child from child slug, while knowing parent ID

I have a hierarchy that I need to get data from. It's the child (by slug name) that I need to get while already having knowledge of the parents. Highest Known Parent Page (slug : 'parent') |_ Child 1 ...
0
votes
2answers
2k views

Reposition Woocommerce Message

I'm trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce ...
0
votes
2answers
953 views

Passing a shortcode attribute to a sub-function

This is both a WordPress and a PHP question, since a PHP programmer may know a technique that the WP group doesn't. I have been attempting to write a shortcode that fires the Foundation Reveal code ...
1
vote
1answer
117 views

Latest post in a specific menu

is it possible to show the latest posts only in a specific menu? This is my menu: register_nav_menus(array( 'primary' => __('Primary Navigation', 'gonzo'), 'mobile' => __('Mobile Navigation', ...
0
votes
2answers
24 views

Date when the custom field was added

I have a couple of custom fields setup and working fine, is there any way to show the date when the custom field was created within the post template? I tried searching around, but no luck. For ...
0
votes
2answers
369 views

Nice scroll to wordpress

I am converting html5 to wordpress Theme. I want to use custom scroll for wordpress. The code DEPENDENCIES It's a plugin for the jquery framework, you need to include jquery in your scripts. I will ...
1
vote
1answer
58 views

Page Automatically Generated from Theme?

I'm running WordPress multisite and would like each site to have a specific page (with pre-loaded content) generated from a page template, contact.php. Rather than go through each site and create this ...
0
votes
1answer
952 views

Problem with isset and $_POST

I have another question. Why I cant get into this 'isset' $_POST["zapisz"] in this code ? What is wrong ? function ow_display_user() { ?> <pre style="text-align: left;"> ...
0
votes
1answer
150 views

Trying to see if page is category or single and displaying title with appropriate heading tag

I'm using a custom theme from ThemeForest and I'm trying to get the custom post php to check and see if the post is on a category or single post. If it's on category, use <h2> for the title (for ...
0
votes
1answer
94 views

Get null from POST

I have problem with my code. I don't know why all my $_Post have null at the end.This is my code: function ow_display_user() { wp_enqueue_script('jquery-ui-datepicker'); ...
0
votes
2answers
276 views

Creating sub-categories via php

Can someone tell me what's wrong here? I'm trying to create a category and a sub-category via PHP. My code is wp_set_object_terms($postID, array($subCategory, $catgeory), 'category'); But that ...
0
votes
1answer
44 views

Show results for multiple page-types

First of all sorry for my earlier post, it was just too confusing, and I asked 3 questions in 1... Okay the code below gets be all the pages with the page type page_library_html_content.php now I ...
0
votes
1answer
82 views

Different image and background color depending on page type

Here is the HTML/PHP and CSS code for a part of my page HTML/PHP <?php $product_pages_args = array( 'meta_key' => '_wp_page_template', 'meta_value' => ...
0
votes
1answer
63 views

Display pages from specific page template

Okay I have found the following code on line, which seems to be working and displaying all of the pages using the page_library_html.php template. This code only shows the title of them though. Can ...
0
votes
1answer
36 views

Backend of the WordPress.com [closed]

It has been known that PHP is under an impression that its a web low performer. However, the size of WordPress.com says otherwise. Does anyone knows why WordPress.com blogs scale so well even though ...
0
votes
1answer
136 views

How to add title attribute to archive items

How can I have the title attribute to each listed archive item, so when I hover an item, it says: view all posts in archive: '' $html = wp_get_archives( array( 'show_post_count' => false, ...
0
votes
1answer
104 views

How to have post count after each listed category

How can I have a post count after each listed category with the following function? Also, how can I apply this with wp_get_archives and also with the same option as the below function? <ul> ...
2
votes
3answers
142 views

Create WordPress pages with PHP

I'm using MongoDB to store separate data for a WordPress website and need to be able to create pages with the data from MongoDB rather than from manually created pages in the dashboard. I've searched ...
0
votes
1answer
116 views

is user member of a group, show them categories [closed]

I want to only display categories e.g. the 'group-1' category to users that are members of a certain buddypress group e.g. 'group-1'. I think I can do this by manipulating this code, and replacing ...
0
votes
0answers
262 views

Infinite scroll jPlayer callback with PHP and post id?

How can I call the correct callback function for infinite scroll plugin on WordPress with variable <?php the_ID() ?> ? I'm trying to connect jPlayer like this: Code in php: <script ...
0
votes
1answer
72 views

How to add ASCII symbol after each recent post [closed]

How do I add an ASCII code after each recent post list item? <?php $args = array( 'numberposts' => '2' ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as ...
2
votes
1answer
623 views

Is it possible to get a theme customizer setting from wp.customize using jquery?

I am wondering if it is possible to directly interop with the wp.customize api to get a value of a theme customizer setting. The way I am doing it now is using ajax to get a response from a php ...
0
votes
1answer
84 views

Template from scratch: Sidebars not showing widget

I have an issue wherein i have a plugin (newsletter) which has a widget whereby users can (usually) subscribe to a newsletter and other functionality. But i digress. I have been trying to create ...
0
votes
2answers
69 views

If Elseif Query

I'm trying to work this query - the first if clause works, and the else works, but the middle clause, elseif, doesn't work. <?php if(get_post_meta($post->ID, 'TourURL', true)) { ...
0
votes
1answer
51 views

Name Input from widget displays Sidebar name instead of saved data

I wasn't sure how to title this question,so I apologize. Let me first state that I have no experience with this type of code but I really need to this feature for my website, so I appreciate all the ...
1
vote
1answer
3k views

Create Image Uploader for Widget

I found this post// Use Media upload in custom widget on wordpress 3.5 I'm not experienced in any of this so I pretty much just copied the code he provided into my own functions.php file. I uploaded ...
0
votes
3answers
70 views

Comparing Dates from custom field

I am trying to compare dates from a custom field. I have them stored as something like "20121125". If the date has expired, a placeholder image will be used, if not, the default thumbnail will be ...
0
votes
1answer
147 views

Compare Two Custom Post Types Using The Same Custom Taxonomy

I have two post types, courses and testimonials, sharing the same taxonomies. What I am looking to accomplish is to check whether a course is in the same category as a testimonial. Then display if it ...
1
vote
0answers
289 views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
0
votes
1answer
77 views

Plugin can't write to database even though permissions appear correct?

I'm using the Formidable Form plugin, and when I try to add a form, the form isn't saved. According to the developer, the user does not have sufficient permissions to write to the database. Here's how ...
1
vote
1answer
47 views

Instantiate class to be available to all plugin functions

I'm developing a plugin for a site that has to communicate with several non-wp tables in a database. For that I made a class that contains all of the MySQL-related functions. When you declare a ...
0
votes
1answer
76 views

Querying multiple meta_keys in Wordpress SQL query

Here's my Query... I'm looking to narrow this query down to users of one specific role ("meta_key = 'wp_capabilities' AND meta_value = 'employee'")...how do I add that additional conditional to this ...
0
votes
1answer
121 views

How do I get taxonomy terms by ID in a specific order

How do I get taxonomy terms by ID in a specific order. Below is my code and I thought if I passed get_terms the arguments to with ID and post_in but I am not seeing the results I thought I should. ...
0
votes
1answer
42 views

Inserting A Feed and Sidebar into an HTML Page

I have a website I've built and the last step is to configure the blog page. My html and css is solid but my php and wordpress development knowledge is almost non-existent. I don't need a dynamic ...
0
votes
1answer
3k views

Contact Form 7: custom validation [closed]

I'm currently using the Contact Form 7 plugin, which is great and works perfectly, but what I'm now trying to achieve with it is some custom validation rules. I found this extension: ...
0
votes
1answer
88 views

Posts without featured image using other post's featured image

I am using the following code (see bottom) to display a custom post called 'artists'. I am also using <?php if (has_post_thumbnail( $post->ID ) ) so I can set the background of a div using the ...
1
vote
1answer
348 views

has_shortcode() - how to detect nested shortcode

I'm using has_shortcode() to detect a shortcode, it works but not at all. If I put this specified shortcode inside another one the has_shortcode() function stops working. has_shortcode( ...