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

learn more… | top users | synonyms (1)

0
votes
1answer
60 views

Conditional using get_the_ID() not working [closed]

I'm using this script to not show title on a specific page <?php if (get_the_ID() != 50){ ?> Now I need to add another page: <?php if ((get_the_ID() != 50) || (get_the_ID() != 317)){ ...
1
vote
2answers
100 views

How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field

I have searched high and low for a solution and couldn't find anything; hopefully someone here more skilled than myself can lend a hand. I have two testimonial videos (from a video custom post type) ...
-1
votes
0answers
49 views

Buddypress + Memberpress [closed]

I am looking to build a wordpress site using both BuddyPress and MemberPress. I know that these plugins have some conflicting areas. Has anyone ever used these plugins together? If so do the two ...
0
votes
0answers
28 views

Can anyone tell me why I can't edit a plugin when it is installed without having to re-install?

I am using a shortcode plugin as a framework for the short codes I want to add that go with my theme. I decided to just include the plugin in a repo for the user to dl so I am not building theme right ...
0
votes
0answers
19 views

Styling every second Post differently? [duplicate]

I wanted to style every second post inside of a query post and I found a solution which nearly works. the thing is: it outputs just two posts (older ones will be igrnored) but i want to output ALL ...
0
votes
1answer
22 views

Appended comments but they show up above the content instead of below

I am trying to append a comments template to the end of the flash object in this plugin file. Below is the full code. To pinpoint exactly where I added the comments template, please refer to this ...
0
votes
1answer
43 views

Wordpress - show number of comments for each post in widget

I have installed a plugin that lets me put a PHP code into the widget - basically, what I want to do is to create a "recent posts" area, where you can see a cover of the post (featured image's ...
0
votes
1answer
128 views

wp_dropdown_pages auto submit

What I have below currently works fine except for one issue: When a select item is chosen, it will correctly go to the subpage - however, if on a sub-page of the main site already, and a item is ...
0
votes
1answer
65 views

Enabling XSendFile causes 404 for images on Wordpress Multisite / Network

I've compiled and installed the XSendFile module and added the following lines to my .htaccess: XSendFile On It shows up as being activated in <?php info() ?> under loaded modules. The ...
0
votes
1answer
61 views

Authentication from sub-folder non-wp cookie WordPress

I have a question about user authentication in my WordPress Multisite site. My site is http://www.drezzy.it that has its own user db with a login and logout system. This is a non-WP website. When you ...
0
votes
0answers
14 views

Show only items from user_role in code

I need add this code to this code http://itweb.sk/script.txt $user = new WP_User( $item->post_author ); if ( !user_can($user->ID,'directory_4') ) { echo "hello"; ...
0
votes
1answer
22 views

Show items by user_role

I have this code, start with {foreach $items as $item} I know that I must connect below code to start code $user = new WP_User( $item->post_author ); if ( !empty( $user->roles ) ...
0
votes
0answers
14 views

Alternative ways to make ajax requests in wordpress [duplicate]

I'm currently having a problem with working with AJAX. Well not really a problem since I can pretty much do what I want to do. The only problem is my boss saying that the admin-ajax.php file is an ...
0
votes
0answers
23 views

Show Message By Tag ID for custom post types

In single.php i need to have some conditionals that ask what Tag the post is in so i can display a message, not sure how to do this, but this is the idea: if post related to tag ID '2' say "hello ...
0
votes
1answer
135 views

Show login greeting above sub-menu links?

I'm using WordPress' built-in menu system to output my Main Menu Structure. I have one sub-menu, and it has two links currently, "Tracking" and "To-Do List". I want the following login greeting to ...
0
votes
1answer
116 views

Correct Syntax for uploading files to custom directory in Wordpress

I have current PHP code that works when attaching files on a form. The files have to go to a certain directory. I know that while attaching in Wordpress I need to use a different syntax. However, I've ...
0
votes
1answer
41 views

get_template_directory adding FTP root folders in urls

I am creating a theme, and now I am adding some functionality for my custom post type, such as different metaboxes in post page, extra post config page. It seems when I try to get the sites theme ...
3
votes
1answer
157 views

Modify image while uploading

I have a plugin which uploads image using wp_upload_handler here is a function: //handles upload, a modified version of bp_core_avatar_handle_upload(from bp-core/bp-core-avatars.php) function ...
0
votes
0answers
33 views

wordpress can't upload plugin

I can not upload the plugin through the admin or cpanel. I am trying to work in localhost. I am getting the following error Unpacking the package… Could not copy file. ...
0
votes
0answers
22 views

Break a Wordpress function to run in patches and re-continue

I am new to PHP and coding and I am really not a coder but I try to modify and use existing codes. I have a function which I am trying to run when needed for all users within Wordpress to do an ...
0
votes
0answers
22 views

custom processing for posts

Although I'm very well aware of PHP, but I'm kind of new to WordPress. So I created this WordPress site, but there's a bunch of posts that I want them to include some PHP and JavaScript and HTML ...
0
votes
2answers
47 views

str_replace not responding in functions.php [closed]

I'm tring to use str_replace within a wordpress function but its not working. My code: function fields($content) { if(is_feed()) { $post_id = get_the_ID(); $url = ...
0
votes
1answer
41 views

PHP Call outside class function inside anonymous function

hey guys i wanna call my function inside class A than call it inside class B within anonymous function how to do that ? here my sample code. <?php class A extends Z{ public function ...
0
votes
1answer
393 views

Woocommerce: Remove Woocommerce default address fields

I am trying to remove / hide some default address Fields like as the Postcode (Zip-code) field in Cart Shipping Calculator / Whole Woocommerce ? Is there a function for this? I found in ...
0
votes
2answers
669 views

PHP 5.5, w3 Total Cache, and opcache

PHP5.5 has ZendOptimizer opcache built in and it seems to work pretty well and the benchmarks seem to give it a slight edge over APC in performance. Great. So APC seems to be on its way out. My ...
1
vote
1answer
39 views

Wordpress not reflecting changed of the database

my problems started when I moved my website to another folder (from /dev/ to /). I have gone through the whole database in order to change all the hardcoded /dev/ into / but I still notice that ...
0
votes
1answer
28 views

Conditional On custom field plugin metabox

I've trying to run a conditional on the custom field I made with the Custom Fields plugin, I made a true and false check box. I just need to check if the box is true or false really. I've tried ...
0
votes
2answers
36 views

How to add feature image url in my template file and content as well?

I am making a template page name new_template.php,here i want to add a feature image source. how to add featured image source on this blank page. and when i add featured image then the description ...
0
votes
0answers
39 views

Calling information from my theme options page

I'm setting up a theme options page, I used it on a previous theme and thought i could easily just copy it over to the new one. <?php $options = get_option( 'sample_theme_options' ); ?> ...
1
vote
2answers
213 views

Wp-login appears White Screen, Error: Cannot modify header information

Possibly duplicate of many Question, the reason I am posting here none of them helps, here is the log which appear on Wp-login.php page. Notice: automatic_feed_links is deprecated since version 3.0! ...
0
votes
0answers
83 views

How to set any theme setting from a custom WP_Customize_Image_Control?

I am using the Theme Customizer API to upload a logo for a WP theme. I also want to let the user set the css for the logo size via a number input in the same Customizer section. What's the best way ...
0
votes
0answers
29 views

How do I call comments_template(); from a plugin file?

I am trying to call comments_template(); from a plugin file. Specifically, it's the player.php file from the plugin All Video Gallery. Below is the file itself. <?php ...
0
votes
0answers
42 views

How to display menu description, but only if there is a sub menu?

Today I've written my own custom menu walker. While I am a bit shocked how difficult this is (also because there seem to be some bugs in Wordpress), I am astonished that I could make everything work. ...
-1
votes
1answer
357 views

Woocommerce Show Single Product on Homepage

I am currently learning PHP & how to customize Wordpress. I have a shop that I set up on Wordpress using the Woocommerce plugin. The shop holds only a single item. Since I only have 1 item to ...
0
votes
3answers
233 views

How can I loop into two different DIVS without repeating the DIVs

I am having a little trouble trying to figure out how I can accomplish this: I have a container with two colums in it, a right and a left column. Each column will have 3 posts with a short excerpt ...
0
votes
0answers
32 views

Custom Post Type Title by Slug

Is there a function which will get the title using the slug, For some reason I need to get the title of the custom post type using the slug Here is the PHP if(isset($_GET["album"])){ $slug = ...
0
votes
1answer
78 views

Why can't I add a custom image in my navigation?

Trying to add a navigation Home icon Failing to work. Here's my nav: <nav id="site-navigation" class="main-navigation" role="navigation"> <h3 class="menu-toggle"><?php _e( ...
0
votes
0answers
39 views

Passing two values wordpress dropdown category

I have been following this guide on how i can pass two values to filter the post instead of one in wordpress category drop-down. The objective here is once the user selects a location and then selects ...
4
votes
1answer
91 views

Is having multiple theme customizers for different pages possible?

If you have a theme that for instance has a blog, front page and misc pages is it possible to have more than one theme customizer, so that you can provide a live preview when editing styles? My theme ...
0
votes
1answer
38 views

How can I get plugin meta data without knowing the plugin folder?

I am looking to get meta data about an installed plugin from another plugin. Theoretically, to get the version, I could do: $data = get_plugin_data( 'expected_plugin_folder_name'); $version = ...
0
votes
0answers
18 views

WP supersize not displaying when different languages flags are selected

I've got a very strange problem with this website. The background slides appear when your English flag but when its switched to The Spanish flag or Other flag the backgrounds don't appear. Link to ...
0
votes
2answers
15 views

Prevent Company Name From Translating

How do you prevent WordPress from localizing a company name when using the localization functions? In the following snippet will "Company Name" be translated? <?php printf(__('Here is some text ...
0
votes
0answers
75 views

Different Product Templates for Woocommerce

I'm trying to make two different templates for two different product pages. I've done some digging around and written a conditional that should wrap the page if that particular product is within the ...
0
votes
2answers
165 views

How to limit the number of results for all query_posts on mysite

I have a huge number of posts and the pagination with no limits eats my server CPU and ram so I need a function to limit the number of posts for all query_posts on my site and I need this function to ...
0
votes
0answers
6 views

Trying to fix my Contact Form [duplicate]

I have been trying to figure out on what is missing in my codes. Basically whenever i click the submit button to send the data in the contact form, it basically returns me to the home page and ...
0
votes
1answer
65 views

get_template_part function and add images

Added this function in any page: get_template_part('recent', 'posts'); And: if(have_posts()){ while(have_posts()){ the_post(); ?> <div class="site-content clearfix"><?php ...
2
votes
2answers
82 views

How to use wp_insert_user on Wordpress Multisite?

I previously had a WordpressMU install, but this is deprecated and I'm trying to find my way around multisite. I need to programatically create a new user account for a particular site. ...
0
votes
1answer
38 views

Displaying Slider in Front Page (home) using Customizr Theme

I am using Customizr Theme on my website, and rendering its' front page, using a Static Page. Also I have two sidebars (left and right). I used the static page, because when I put the slider it will ...
0
votes
1answer
85 views

Custom ajax call returns 0 [duplicate]

I' am still searching on why am getting 0 when doing a ajax call on wordpress. I know that when a ajax call is successfull it returns 0. I' am returning some value from the ajax call and it returns 0 ...
0
votes
0answers
30 views

How to escape shortcode content? Do I even need to escape or validate?

I've written a small shortcode that wraps it's content into a HTML element, like so: [my_shortcode]The sun is shining today.[/my_shortcode] In my shortcode function, I basically return the string ...