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

learn more… | top users | synonyms (1)

0
votes
0answers
18 views

Automatically require PHP files causing error in wp-admin

I have been using this function to automatically require in PHP files. function req_php_files($filepath) { $Directory = new RecursiveDirectoryIterator($filepath); $Iterator = new ...
0
votes
1answer
37 views

PHP getting error when trying to access WP-Admin Dashboard

I'm unable to get into the backend of my site, and it's throwing the error Warning: require_once(/home/piximotion/public_html/papillontailor.com//home/piximotion/public_html/papillontailor.com/...
0
votes
0answers
58 views

Hide empty categories from get_categories

I'm trying to hide the empty categories (with no posts associated) from a list in an archive page. I'm using hide_empty as suggested on Wordpress codex but it's not working, the code outputs all ...
0
votes
1answer
13 views

How do I routinely extract the thumbnail of the most recent post?

I would like to write a PHP snippet that can communicate with Wordpress. When a new post is published, a file today.jpg will be generated from the thumbnail url (a custom field) of the most recent ...
0
votes
0answers
62 views

How to stop printing header, footer, sidebar and other items (Tesseract theme)?

My screen pages look fine. All elements on a page look like they will print on one page. When the page prints, the header, menu (drop down), footer, social media icons at bottom (also showing link url)...
0
votes
1answer
37 views

How to order users alphabetically by name? in plugin UPME

I have this code: <?php class UPME_List_Cards { public $upme_options; public function __construct() { global $upme; add_shortcode('upme_latest_members_list', array($this,'...
0
votes
1answer
19 views

Wp_mail doesnt work

I created a form for mail sending, but it does not work. Email function is enabled in php. if (!$error_msg) { $to = "mail@to.send"; $headers[] = 'Content-Type: text/html; charset=UTF-8'; $...
0
votes
1answer
18 views

get_page_templates only return templates with “home” in the filename

I have the following custom page template filenames: template-about-1.php template-about-2.php template-home-1.php template-home-2.php I have this function to get_page_templates: function ...
0
votes
0answers
20 views

Allow one use group to manage another

I have a website where members and their managers have accounts. The members can create and upload their content, but the managers have their own login and can see a list of the members they manage. ...
0
votes
0answers
62 views

Blank screen on wp-admin

I know this question has been asked tons of times but it was all outdated; I tried every single thing and it still doesn't work. Here is what I tried so far: Renaming the folder Renaming plugins ...
4
votes
1answer
215 views

Retrieve POST data from AJAX call

I have the following JS script : jQuery('#form-recherche').submit(ajaxSubmit); function ajaxSubmit(){ var newFormRecherche = jQuery(this).serialize(); jQuery.ajax({ ...
0
votes
1answer
24 views

How can I use a text and a function php

I want to display a text and a function in same sentence: <?php echo 'Right sidebar'; ?> <?php echo the_content(); ?> Something like this: <?php echo 'Right sidebar' the_content(); ?...
0
votes
0answers
34 views

Custom database query with accents returning no results

I have an issue where using accents in my custom database query (wpdb) returns no results. $wpdb->get_results( "SELECT * FROM table WHERE city = 'Montréal'" ); Returns nothing, while $wpdb-&...
0
votes
0answers
46 views

Make shortcode work in all posts displayed by loop, not just the first one

I have a post archive displaying post and author meta at roadtripsharing.com/road_trip I added a do_shortcode(); in the loop, specifically related to the "New Message" button which opens a dialogue ...
0
votes
0answers
23 views

function to write the output of a variable + post_title in post_content

I have a function that writes the output of a function of a rand_keys + the post_title in post_content, but writing the title but only happens after I click manually on the update button on the post-...
0
votes
1answer
17 views

Create page in templates for pages or the pages manager?

In terms of slowness and loading which differences noted in the pages created as a template and created by adminisrtador? Example template page: <?php /** Template Name: My Page name */ ........
1
vote
1answer
36 views

Wordpress Hook that will run when media file deleted

I am very new in wordpress and I am currently developing a wordpress plugin, I just want to know if there is a wordpress plugin hook that will run when one or more file of wordpress media is deleted. ...
0
votes
0answers
22 views

Passing Numbers & Letters in Query Strings

I have been fumbling around with this for 45 minutes now, and can't seem to get anything working 100% as I need it to. I am developing a plugin to allow multiple query strings (1 for "level" and 1 ...
0
votes
0answers
26 views

Display most popular posts

I have already found a way to display recent posts: <?php $args = array( 'post_status' => 'publish', 'numberposts' => '60', ...
0
votes
2answers
41 views

Get Custom URL For Custom Taxonomy

I've got a custom post type called productpopups, and to sort them I have a custom taxonomy called productcategory. The post type has it's own special template (single-productpopup.php) and I'm trying ...
0
votes
1answer
12 views

Recent posts with featured image or fallback image with permalink

In my sidebar.php I have some code that prints the recent comments. I could not share the complete code here because of the formating restrictions. You can find the code here: https://codeshare.io/...
0
votes
1answer
213 views

Integrating PHP into Javascript to display map markers with Google API

I am getting one map marker to display but not multiple markers. However the data displays in the HTML log. I think I am missing a loop or did not use my current loop correctly. Anyone who could ...
-1
votes
1answer
40 views

Using a filter in functions.php to add content to single posts regardless if post is in main or child category

Im using following filter (codex) to add some html content with a lower priority (20) to the bottom of my single posts wich are in a specified category: add_filter( 'the_content', '...
1
vote
2answers
114 views

Featured image fallback link to permalink

I use this to display the featured image for each post. If the post does not have a featured image, a generic image will be displayed: <?php if ( has_post_thumbnail() ) { echo '<a href="' . ...
1
vote
1answer
27 views

Page vs Custom Post Types Differences/Issues

I started noticing issues last week when 4.5 was released and mistakenly believed that update caused an issue. In reality, I just happened to notice it for the first time around then because last week ...
0
votes
1answer
61 views

Calling a save function from a “submit” button

I am trying to call a function to save changes from a submit button, but I am not accustomed to PHP programming, as I have just started. I tried Googling around a bit, but didn't find anything too ...
0
votes
0answers
69 views

wordpress custom numeric pagination next / previous / last not showing

I'm using a custom Numeric WordPress Pagination on a page template using a wp-query, based on this tutorial : tutorial I have the numeric pagination working fine, and the page counter also. but the ...
0
votes
2answers
37 views

Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?

This is my first go at making my own shortcode. What I am trying to do I have 11 different outputs for star ratings I want to be able to use in posts. I want to wrap it all into one shortcode, and ...
0
votes
0answers
61 views

Output Video Download Link in template

I have a website that uses a "video" custom post type to display self hosted videos in post. I am trying to figure out how to make a download link for each video that uses this "video" custom post ...
0
votes
1answer
64 views

Setting value of session with Ajax not working

I´m kind of new to using Ajax but I am trying to update the value of a session using Ajax. The Ajax call shoud fires when clicked on a button. When I click on this button it also returns the succes ...
0
votes
0answers
28 views

Adding extra rows to form, and saving values entered.

I am attempting to create a quote-form where the user can add as many items as necessary. I would then like to take the values entered and output them to a html table in an email. Here is the ...
3
votes
1answer
90 views

How to get the registered sidebar's name by its id?

Let's say I have this code in my "functions.php": function mytheme_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar Name', 'mytheme' ), 'id' ...
0
votes
0answers
18 views

Click to expand menu

I have the following menu in Wordpress: https://jsfiddle.net/L3y2rno8/ (renderd HTML) The menu is using a custom walker in my theme functions.php: function wp_nav_menu_attributes_filter($var) { ...
0
votes
0answers
14 views

Show page title in links sitewide using a value from a meta field for AB Testing

I am building an AB Testing plugin. I have built a repeatable set of meta fields where each set of fileds will represent a new AB Test Variation. The main content of a variation consists of a title ...
-1
votes
2answers
44 views

foreach all the post

How to i foreach the post title like below. this is what i want below function get_all_post_for_search() { return array ( array( 'name' => "Hello Project", 'thumb' => '...
1
vote
1answer
25 views

Executing `createimagefrompng()` from save_post hook (or equivalent hook)

I'm having trouble executing createimagefrompng() from a hook. I've used the fairly straightforward PHP way to add a watermark to an image. If I hardcode the image URLs in this function and for ...
0
votes
2answers
40 views

Is it save to use eval for a jQuery callback method coming from the database?

I'll be brief and hope I can explain my scenario correctly. Here's my scenario. The jQuery slider plugin has an anonymous callback method. I would like to give the Admin the ability to create a ...
0
votes
1answer
78 views

Warning: call_user_func() expects parameter 1 to be a valid callback, function

I keep getting this error when. I am trying to insert a dashboard widget and I don't know what's causing the error. Warning: call_user_func() expects parameter 1 to be a valid callback, function ...
0
votes
1answer
58 views

jQuery accordion menu

So I have just started developing a theme with _s (underscores) as a basis. For three days straight (almost) I have been trying to make an accordion menu sort of like this: Example: https://codyhouse....
1
vote
1answer
37 views

Undefined offset: 0

Here is my PHP function function getUserIDandPush($ul){ global $table_prefix; // Prefix for Database table global $user_login; global $wpdb; // Wordpress WPDB database method $dt = $...
0
votes
1answer
48 views

echo esc_url( get_permalink($post->ID) + complete the ID's url

I am in a deep trouble I try to only display the content of a post after clicking a bouton in order to not have the header and the footer again. Manually I have downloaded the plugin "Show Content ...
0
votes
0answers
59 views

Display category name only once inside loop

I have been researching on how I can output the category name on a wordpress loop for custom post only to display only once. If there are any posts under the same category, the category name will not ...
3
votes
2answers
101 views

wp_insert_user role not working

I have be trying this all day but it is not working how do I set a role for the current user I am inserting with the wp_insert_user() function $userdata = array( 'user_login' => $username, '...
0
votes
0answers
20 views

List all post from different post type on one page by CPT UI

I am a php begginer. I am using CPT UI plugin for one of my projects - free resources for designers. The idea is to have different pages for different type of resources. So I will create different ...
0
votes
3answers
42 views

Division by zero error in image.php

Checking my error log on the server I continually see the error: PHP Warning: Division by zero in /public_html/wp-content/themes/sass-wordpress-bootstrap-master/image.php on line 95 Here is the ...
0
votes
2answers
54 views

Show custom taxonomy not in submenu

I have one small problem and I can't find answer...I have created custom post type and custom taxonomy, but my custom taxonomy is showing as sub menu under custom pos type, here is example what I ...
0
votes
1answer
16 views

Wordpress PHP syntax doesn't seem to be working correctly

When I run this wordpress query, instead of the background image showing I just get the end of the div string echoed out? The image string appears in the browser inspector, but not to the screen. Here ...
0
votes
2answers
55 views

Relative post date in recent posts list

I have basically worked on this all night and I realize I am quite stuck. I have a sidebar in my wordpress theme that displays the most recent posts. The sidebar looks like this: Below each title ...
-2
votes
1answer
23 views

wordpress theme breaks in inserting an external php ? possible mistake in folder config?

I am new to wordpress and following is my scenario. I am inserting an external php script in wordpress by creating a new template in the theme and then using that template in a new page. When I do ...
-2
votes
1answer
51 views

True or False: Is an Apache error or PHP error the same as a WordPress error?

I am using CentOS 6; Apache 2.2.2; MySQL 5.6; PHP 5.5.31; WordPress 3.8.13 . I do not have root access to this server because it is shared. I do have FTP and SSH (with some limits to functionality). ...