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

learn more… | top users | synonyms (1)

0
votes
1answer
48 views

How to access global variable $menu inside a class function

am puzzling why can't i access the global variable $menu inside a php class function class adminMenus { public function getWPdefaultmenus(){ global $menu; return $menu; } } using ...
0
votes
0answers
14 views

Undefined index notice when using the $args parameter in add_settings_field()

I'm using the Settings API to provide my admin-user with some options for a plugin I'm writing. I have about 30 text fields to output on the plugin options page so I have created a very general ...
0
votes
3answers
69 views

WP_Query fails despite having 1 post

I'm doing a typical custom post type query with args like this: array (size=4) 'post_type' => string 'custom_post_type' (length=15) 'post_status' => string 'publish' (length=7) ...
0
votes
1answer
32 views

Dynamic CSS through PHP issue

I am trying to create a dynamic style.php stylesheet. The most basic function I am testing is a color picker on my theme-options. The color picker works, but my dynamic css file does not. On Chrome I ...
0
votes
1answer
60 views

PHP if have image display image, if else text

I'm a front-end web developer struggling with some theme option support. I am struggling to write a simple function in my header.php which allows me to do the following: "if user uploads an image, ...
1
vote
1answer
36 views

Why use the Settings API over a new administration menu?

I'm writing a 'quote-me' plugin which provides the end-user with a quote based on data they submit through a front-end form. The quote is calculated according to a price list. The price list varies ...
0
votes
1answer
36 views

Saving category as insert post

I'm having a problem with $_POST a category. I got something like that : // ADD THE FORM INPUT TO $new_post ARRAY $new_post = array( 'post_title' => $title, 'post_content' => ...
2
votes
1answer
44 views

Enforcing password complexity

We need to enforce password complexity in a wordpress site, we used this article: http://www.webtipblog.com/force-password-complexity-requirements-wordpress/ We created the following in ...
0
votes
1answer
26 views

Wordpress plugin creating sidebar on the theme/page

I am creating a plugin and I need it to create a sidebar on the page, but I have no idea what to do or what to search. So once my plugin is activated, the sidebar needs to appear. The color and text ...
0
votes
0answers
17 views

Add custom dynamic string to permalink structure wordpress

I am adding dynamic string to permalink but the problem is all the pages which runs from page.php goes to 404 whereas the detail page of the post is working fine. Code: add_filter('post_link', ...
0
votes
0answers
39 views

Using strpos with WordPress

I have a navigation bar that uses strpos to highlight the tab of the current page the user is on. This method works fine as: <a <?php if (strpos($_SERVER['PHP_SELF'], 'current-journal')) echo ...
0
votes
1answer
53 views

W3 Total Cache Can't Really Detect Things

I'm running Apache + Cpanel with PHP installed as an apache module. I've been trying to setup W3 Total Cache to see the php and apache extensions, and I've been having trouble. It detects curl and ...
0
votes
1answer
54 views

Ajax contact form return 0

I have a contact form that I want to submit using ajax. It seems like send the data, but the only retrieved is 0. HTML form: <form method="post" ...
-2
votes
2answers
62 views

Set variable in javascript and using in my shortcode

my script is function($) { var google_map_address = $('#address').text(); $(function () { $('#gmap').gmap3({ marker: { address: google_map_address }, map: { options: { ...
0
votes
1answer
28 views

Wordpress widget in custom theme

I created a custom theme and writing a basic widget for my wordpress based website. If I paste the code in functions.php the code works fine, however if I paste the code in a separate file and keep it ...
0
votes
1answer
32 views

How do I / Is it possible to execute an external PHP file / function inside Wordpress?

On my set-up, there is the regular website which consists of a header and content (both printed from separate PHP files located in domain.com/includes/) and a Wordpress blog based in a subdirectory ...
0
votes
1answer
30 views

get_the_term_list give me a whitespace

I'm using this code to get my term list, It works fine, but it also give me a white space before my TERM name, Any thoughts? <span class="metaorange"><?php $terms_as_text = strip_tags( ...
1
vote
1answer
38 views

Plugins not working on AJAX requests

I have an AJAX request that retrieves information from a function I coded in my own plugin, here is how I set the ajax function: function my_ajax_function () { do_action('my_plugin_function'); } ...
0
votes
2answers
35 views

posts_nav_link pulling in multiple post types

I have an archive-regularproducts.php set up that looks like so: PHP: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> //content goes here <?php endwhile; ...
1
vote
1answer
71 views

how to put the logo in the center of other items in the navigation bar

I'm developing a website in wordpress and I have to create a navigation bar in which the logo of the website has to be put between items like this: item1 item2 LOGO item3 item4 I'm thinking to use ...
0
votes
0answers
38 views

Custom navigation menu with awsAccordion

I'm making a custom template for my client. Well i'm strangling for hours, for making the vertical accordion menu dynamic so my client can change the nav links etc. The structure of the navigation is ...
0
votes
1answer
68 views

How to add php stylesheet to admin section instead of admin_head hook

how can we do the below code using separate file let say admin-style.php add_action('admin_head', 'custom_admin_style'); function custom_admin_style() { $bg_color = get_option('custom_color'); ...
0
votes
0answers
124 views

encounter server issues while uploading files into meta-slider

good day errors i encounter while tryin to upload files into this slider my system: wp 3.9.1 fresh install meta slider - Example-file 170 kb errors a. Unable to create directory ...
0
votes
0answers
10 views

How can I disable the comments page display from one of two comment fields

I have a Wordpress blog with a second textarea added as a additional field. Both comment boxes are generating comments in the post. The additional textarea comment box is populating the ...
0
votes
2answers
43 views

Closed html class after counter = multiple of 3

How to closed my class in multiple of 3. i don't want to use this if ( $counter == 3 || $counter == 6 || $counter == 9 || $counter == 12) { $output.=' </div>'; } but i ...
0
votes
0answers
36 views

Ajax doesn't work on second call

I'm using Ajax to load posts into a sidebar that are filtered by a chosen category. It works perfectly fine the first time, but for some reason the second time it loads a mixture of results from the ...
0
votes
1answer
30 views

Parse error syntax error unexpected t_string [closed]

I'm getting the following error: PHP Syntax Check: Parse error: syntax error, unexpected 'qtip' (T_STRING), expecting ')' in your code on line 14 in this code: <?php // Always use ...
2
votes
1answer
58 views

How to get the post count for the last x days filtering by categories

How can I get the posts count for eg the last 4 days, but only for specific categories eg. (1,2,3)? Thanks in advance.
0
votes
0answers
38 views

Append argument not working in the wp_get_recent_posts function

I want to append some WP posts to the normal search function but when I run the wp_get_recent_posts function (with the append and the posts IDs in an array) I dont get the posts I wanted to append in ...
0
votes
0answers
35 views

How to link PHP pages not included in menu?

I'm developing a plugin which has basically four pages in menu, each page contains a form that the action value should link to another page (not included in menu). My questions are: how do I link the ...
0
votes
0answers
24 views

What is the right way to include my Ajax script in wordpress [duplicate]

I've searched around for a solution to my issue to no avail. So here it is: I have created custom meta fields in the user section within the admin area. There are two fields in total, both select ...
0
votes
1answer
63 views

Ajax - Call to undefined function get_option()

So I've been working in Wordpress lately with Ajax and I managed to get some stock data into my site from my database. However, I am now trying to use Ajax to load Wordpress posts into my left ...
0
votes
1answer
55 views

List sibling pages widget, exclude current page

I successfully created a widget that displays sibling pages to the current page I'm on in the sidebar. Only thing is, I'm not capable of excluding the current page - can someone please assist here? ...
0
votes
2answers
55 views

Taxonomy term count

I have a custom post type called "RESOURCES" which I used to create a directory of resources on my website. This CPT has the taxonomy called "PRICES". There are three terms free free trial premium ...
0
votes
0answers
38 views

Ninja Forms - pull in some post related information

I am building a real estate website. There is a custom post type, called "Agents", that holds all the contact info, like the email address. I also have a custom post type called "Properties" where you ...
0
votes
0answers
36 views

Change taxonomy for categories

I am using a plugin called "Recent posts widget extended" with a directory theme where i have directory listings showing as adverts in a sidebar on specific pages. The plugin allows me to show posts ...
0
votes
1answer
41 views

How do I convince this button to do something when it is clicked?

I'm trying to use ajax to give me an alert when I click a button. Eventually I want it to do some form validation, but for now I would be happy just to see the alert. I've read the docs and about a ...
0
votes
0answers
30 views

Question about file path for include/require methods

So I am currently rather new to Wordpress development and I had a question about the file path for the include() and require() methods. I have a php script within my Wordpress installation that I ...
0
votes
0answers
34 views

Query category-specific, paginated posts and allow viewer to change sort order

Maybe this has already been asked here, but I can't seem to find a solution, so forgive me if this is a duplicate. I have coded a custom template to display all posts from a category with the ID 36. ...
0
votes
1answer
52 views

Accessing Variables Used In a Plugin Using PHPStorm + XDebug

I'm currently attempting to use XDebug 2.2.1 and PHPStorm 7.1 to debug my WordPress plugin. So far, I've successfully installed XDebug and breakpoints are working fine. However, I'm unable to access ...
0
votes
1answer
25 views

Showpost and last

I need your help. I would like to bring up the last (number) from my template classified ads. Here's the code: <?php $the_query = new WP_Query( array( 'showposts' => 10, ...
0
votes
0answers
17 views

Make first child link default instead of its parent

I want to do something like this: if a parent have kids get page link of the first child else get page link of itself. For example: Page 1 Sub-page 1 (get this link) Sub-page 2 Sub-page 3 Page 2 ...
0
votes
0answers
38 views

How to show grand total of echoed values?

Using Advanced Custom Fields, I have a WP page setup as an Asset Register with repeaters which shows: Example: Asset Acquisition Value - $100.00 and Depreciation - 10% Fields are repeated for ...
1
vote
0answers
74 views

Using color picker in plugin, does input attribute order matter?

I'm trying to use the WP color picker in a plugin admin menu and it doesn't seem to be doing anything at all. I'm following the directions here: ...
1
vote
1answer
281 views

WordPress (3.9.1) MultiSite Permissions. Is chown the answer?

The situation: I'm working on a WordPress MultiSite for a charity. They have a Dedicated Apache Server running multiple Domain Names (Accounts). I preparation for Development & Production, which ...
0
votes
0answers
27 views

Nested wp_query loop doesn't show connected posts

I have have a wp_query loop nested in another wp_query loop. The first loop queries the latest movies. The second loop queries the persons connected to each movie from the first loop (movies and ...
0
votes
2answers
63 views

Display custom meta box in my template file

Need help displaying my custom meta boxes on a template file. Following a tutorial Here's the code from my functions.php: function get_custom_field( $value ) { global $post; $custom_field = ...
2
votes
1answer
153 views

Wordpress Visual Editor Stripping HTML Changes

When I use the WordPress HTML editor to add icomoon icons like this: <span class="icon-shield"></span> and then switch to the visual editor and then back to the HTML editor, the icons ...
0
votes
2answers
62 views

How can I call specific function if requested URL is not found?

My website is fully API based and builds pages/posts from API data. I was thinking to create something like PHP magic function __call to call specific function when requested URL would return 404, but ...
0
votes
1answer
31 views

Custom posts in different columns style

I'm trying to output a custom type posts with a sticky/featured work in a col-8 (thumbnail) and col-4 (content) then the rests of the posts should be in col-4. So far I have tried the code below but ...