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

learn more… | top users | synonyms (1)

0
votes
1answer
27 views

child parent styles enqueue order

I have a wordpress theme which I hacked to my specifications. I know I'm not supposed to do that but it was long ago so now I'm trying to implement a child theme and I've put those revisions into the ...
0
votes
1answer
46 views

Need help removing […] after excerpt

My website is watersedgeofshelton.com and i need help removing the [...] after the excerpts on the blog posts (under activities, marinas and restaurants" I read that I had to add this code to my ...
0
votes
1answer
18 views

Conditional string comparison failing for basename/slug

I am trying to display a particular block of html for one page in particular. I have created a conditional statement that compares the basename of the page to my string. <?php if ( has_tag( '...
0
votes
1answer
19 views

Getting the date_diff function return the difference in days

I've been trying to build a feature to count the days it takes for products to be sold. We are selling unique items on behalf of our customers so it's good to know for reporting and product management ...
0
votes
1answer
24 views

Limit Taxonomy Output in Conditional Statement

I am trying to limit the amount of category tags I output to 5 as well as append a "..." to the end of any items where the output was limited. I've got it mostly working except I can't figure out how ...
0
votes
0answers
20 views

wpdb->prepare clarification

Is there anything wrong with using wpdb->prepare() to retrieve items from a custom database table? Note how I've used prepare() below, without passing the $type variable through prepare(). I just ...
2
votes
2answers
52 views

Page Reloads Before AJAX Request Finishes

I am working on a WP plugin, and I need to be able to call a URL (specifically an AJAX function) using a button click, but the page refreshes after clicking it, which I think is preventing the AJAX ...
-1
votes
2answers
64 views

How to wrap every 3 posts in a div (and close the last div too) [closed]

I have code that wraps every 3 posts in a div (so that the posts will line up horizontally even if different heights). It closes the div after 3 posts, but the problem is the div is left open if there ...
0
votes
1answer
69 views

Convert canvas to image and upload image to server

I'm working on a wordpress site about blackout poetry for a university project, where the user can blacken parts of a text to create a poem. After the user has created his poem, we need to give him ...
0
votes
0answers
24 views

Issue with search form admin panel after PHP migration

I have website hosted on OVH, and currently I am using PHP v. 5.3. Since OVH will stop supporting it soon I have to migrate to 5.4, 5.5, 5.6 or 7. I've tried 5.6 and 7 but what happens is that ...
0
votes
1answer
76 views

Remove &nbsp; at the beginning of the_excerpt() with str_replace

I am trying to remove blank spaces at the beginning of the_excerpt();. They are cuased by blanc spaces between two images in the content. I have unsuccessfully tried to get rid of them by using ...
0
votes
1answer
30 views

get_users meta_query: REGEXP not working for matching new lines

I have a meta field "my_meta_field" which may contain the following for these sample users: User A 99999 559225 12519 User B 5020492 99999 125191 User C 194295 1199999 Newlines are \r\n or \...
1
vote
1answer
90 views

Upgraded to php7.0, now ssh updates don't work [closed]

I updated my server from Ubuntu 15.10 to Ubuntu 16.04, and one of the things that updated was PHP. After the upgrade, doing plugin updates over ssh don't work any more. At first it was prompting for ...
-2
votes
1answer
40 views

how to use header function in wp-load.php file [closed]

I am making a file that is used for downloading files that are stored in my website. But when I try to download the file on clicking a button, it does not load the file. I am using header function to ...
0
votes
0answers
32 views

How to change the capabilities from upper case to lower case, while inserting onto database?

I am trying to insert custom user roles like Student, Teacher and Parent. While inserting the capabilities into the database, it is displaying the role in uppercase. I am not able to fetch the user ...
1
vote
0answers
16 views

save imported posts as drafts

i m trying to import data into as my posts using wp all import and use add_action(save_post,myfunc) to run a function to update some fields all's good so far...but instead of publishing them all at ...
3
votes
1answer
41 views

Creating search filter through plugin

I'm using wordpress for real estate project, for that, I am using a theme together with a plugin (realia real estate) to real estate. So I believe that this not is beside the point ... My question is ...
0
votes
0answers
32 views

Custom Page Load by wp_query

Is there a way I can use wp_query to retrieve custom pages and posts, and display them on the front page of my WordPress site? I'd like to do that for every custom page I have, to end up with a one-...
0
votes
1answer
24 views

Output custom text field as unordered list

I am quite new to php. I am using advanced custom fields and have a custom field with the name tags. Users are inputting content such as: Tag 1, Tag 2, Tag 3 I would like parse this output and ...
1
vote
1answer
72 views

How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table

I am trying to implement WP_List_Table for my plugin. I have gone through this tutorial and using its sample plugin. I have installed this plugin and just changed table name and done slightly ...
0
votes
1answer
29 views

How can I properly control the numbers and dots that appear in pagination?

I have custom pagination that allows me to modify the mark-up for the code WP outputs: in functions.php function wp_custom_pagination($args = [], $class = 'pagination') { if ($GLOBALS['...
1
vote
1answer
38 views

How to output widget

I have the following code to display widgets in the customizer. function arphabet_widgets_init() { register_sidebar( array( 'name' => 'Social Media button', 'id' => ...
6
votes
2answers
114 views

Uploading media with the REST API

I am having trouble when uploading media to a WordPress site with the JSON REST API. With the following code I can upload the photos, but no info is assigned to them, not even the name - in fact the ...
0
votes
1answer
31 views

Dividing the loop to style post differently

I'm using a plugin that displays post and shows them in a certain area on my site, such as the sidebar or anywhere i put the <?php;?> code, but only if the author that is writing the post clicks ...
1
vote
1answer
35 views

Custom query, checking values of multiple meta keys

I am using two plugins, and I have some issues combining them. One is an event calendar, which add new meta keys to posts, the other is a show-posts-as-grid plugin, that fetches the event posts from ...
-1
votes
1answer
27 views

Advanced custom fields Repeater conditional statement not working [closed]

Even if no value for a field is entered my elements inside my echo still show inside my conditional statement. Thinking that is just checking if the field exists rather then checking if a value is ...
0
votes
0answers
15 views

add_rewrite_rule to fix fastcgi issue with basic AUTH

The issue is that $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are not populated if PHP is running CGI/FastCGI as the server API. I've read there is a possible fix with this through htaccess ...
0
votes
0answers
10 views

Pulling in post ID into Live Edit functionality

Pulling in post ID into Live Edit functionality I've got a social media site built off BuddyPress, where we've built custom post functionality off ACF fields, and I need to tie in front-end editing ...
1
vote
1answer
29 views

Archive post by meta value + 24hours

I'm using this code to archive some custom post type : $where .= " AND wp_postmeta.meta_value >= now()"; The metavalue is a date field. On the day of the value of the datefrom has been setup the ...
0
votes
1answer
28 views

Include a php file from another plugin

Inside one of small custom plugins I really need to inlcude a file from another plugin, in order to be able to create and save obhect of a class that is declared there. What I have tried and the ...
2
votes
0answers
35 views

my function doesn't return my post from today

I'm using gravity form to create some custom post type - as events. Everything is working great, There is some date field to setup the event from x to y date. ALl of this working great. However, I ...
0
votes
0answers
30 views

How can I add rewrite rule for custom page?

I'm showing child categories data in custom page using wordpress. Problem is that i'm fetching those child categories from parent category slug. www.example.com/digital-post-page/?cp=category-slug ...
0
votes
1answer
54 views

Advanced Custom Fields Image Field returning ID instead of URL [closed]

I'm using ACF to add custom fields to a User. I'm trying to output these fields to the front-end. I was able to pull all fields, but when I was trying to get the img it wouldn't pull. Here's my code: ...
0
votes
1answer
41 views

Setting up the child theme so as to enable right-to-left WordPress?

I want to make a child theme for twentyfifteen theme in WordPress to show in right-to-left direction. I read the documentation on that in Codex. But to be honest, the documentation was good for a ...
0
votes
0answers
36 views

wp_mail Not Working Correctly

I am trying to use wp_mail to send an email with an attachment, but there are a few issues: 1) The attachment does not appear 2) I have to use the direct URL to send the email (not working on button) ...
2
votes
1answer
84 views

Understanding child theme functions.php

I have successfully created a child theme for the Emmet Lite template, using the information provided on here and here The CSS file of the child theme looks like this: /* Theme name: Emmet Child ...
1
vote
1answer
68 views

Store and Work with huge array in WP [closed]

I need to get all terms that have post with dates in custom field. So I need a list for all dates from the term. I need to know exactly what is tha dates within each term in my site. It's not in term, ...
0
votes
1answer
34 views

Get css class of menu item in custom menu structure

So, I've created custom markup for a menu. The functionality of the menu is built like so... <?php $parent = array(); if (($locations = get_nav_menu_locations()) && isset($locations[...
0
votes
2answers
70 views

Shortcode is not outputting all of the desired markup

I'm having trouble getting my shortcode to output all of the markup - for some reason it's only outputting part of it. I have the following function: function shortcode_container($atts, $content = ...
0
votes
1answer
38 views

Getting a variable inside foreach from PHP to JS after localization

I believe I have properly enqueue'ed and localized my script - I've got $q showing up in the DOM. Now I'm sure I'm missing the simple last step to accessing a variable in the JS function. Here's my ...
0
votes
1answer
38 views

Conditional featured image with youtube thumbnail

Basically what I am trying to do here is: Display the youtube thumbnail. If no youtube thumbnail -> Display the Featured image for the post. If no featured image -> Display the fallback image. ...
0
votes
0answers
7 views

post_row_actions to print pdf

I'm a bit of a newbie wordpress dev so apologies if this seems like a bit of a stupid question to ask. I'm trying to add a plugin which will allow me to print posts as custom styled pdfs. I've added ...
0
votes
1answer
21 views

Need to adjust condition to say if I'm pulling categories from a post, to pull only the first one

I have a condition to pull posts based on category so when in my single.php users can see related posts based on categories, but the problem here is if someone posts a post with more than one category,...
-2
votes
1answer
31 views

How to find out the URL of enabled theme(s)?

I've done some research, but can't find a solution. I want the URL or my themes. For example: example.com/atheme example.com/btheme example.com/ctheme This is to make a drop down so anonymous ...
0
votes
1answer
64 views

Merging two excerpt functions to work with conditions

I have two functions that affect the_excerpt: // Grab First Paragraph Of Text And Ignore Images For Excerpt function awesome_excerpt($text, $raw_excerpt) { if( ! $raw_excerpt ) { ...
0
votes
1answer
19 views

Using Conditionals when homepage is a page and blog is /blog

I am setting up a blog with a static front page (name: Front Page, slug: front-page) and the blog on a page named "Blog" with the slug "blog". What I want to do is have my site title be inside and h1 ...
0
votes
1answer
22 views

Get dimensions of logo

I have the following code installed in my header.php: <h1><img src="<?php echo esc_url( get_theme_mod( 'mitch_logo' ) ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display'...
0
votes
0answers
45 views

Advanced search query select from custom table

Hope that anyone can help me with this problem. I have 7 columns in my tbl2014wines custom Wordpress table. I am trying to create an advanced search feature that allows users to search by wine_name, ...
1
vote
1answer
58 views

Use Timber/Twig to pull an image by image ID [closed]

Is it possible to use Twig to pull an image by ID, or only to pull the post.thumbnail? The Twig docs don't seem to cover any other image need and I'd like to specify a backup image in case no post....
0
votes
1answer
17 views

Showing featured image of page's child's children page

so i have a page that has children pages acting as categories, that each have children pages themselves (parent > children > children of children). How would I go about showing the featured images of ...