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

learn more… | top users | synonyms (1)

0
votes
0answers
42 views

WooCommerce: Making a loop create divs of categories, with category products inside

I have a php/wp script written which in theory should print a div with a category name, description, and all of its products inside. The code looks like this: <?php $args2 = array( 'taxonomy' =&...
0
votes
1answer
31 views

add button to specific post

This code is designed to add a button to specific posts using the get_post_meta function. How do I alter the get_post_meta function to display this button on a specific post? I have already tried ...
0
votes
1answer
88 views

How to change post count in wordpress loop?

Hey I am attempting to customize my WordPress post loop to create different post styles for a certain set of posts. For example the first three posts would be styled in it’s own way, the next four ...
0
votes
1answer
24 views

show recent posts php code error?

I'm using this code to show my recent posts in my website: <div class="post_content"> <div class="home_posts"> <?php $args2 = array( ...
0
votes
1answer
49 views

Loop 1 user randomly

At the moment I am using wp_user_query to loop users from a specific role(leden) on a webpage. For the overview page this is working fine, but on my homepage I want to feature one random user. I was ...
0
votes
0answers
26 views

Passing variables through links?

On my website, www.tremarctos.com, I have several photo galleries sorted by category. Clicking on a photo sends one to an individual photo post, and one can navigate between individual photos using ...
1
vote
1answer
27 views

Trying to remove post thumbnail with plugin

I have a plugin that need to remove the post thumbnail under certain conditions. Tried to hook to "get_post_metadata" filter but the code doesn't seem to work. Here's my code: public function helper(...
4
votes
2answers
360 views

Get php var inside javascript file (making plugin)

I was making a plugin and I have a javascript file where I want to take some options saved in the database to show well the function. So I have this: function wp_home(){ wp_enqueue_script( '...
0
votes
1answer
41 views

Looking for a better way to handle an ajax script that pulls in post data on click

I've developed a template page that displays a grid of "employees" (a custom post type). That part works fine, but I also needed to set up a lightbox to display additional details on click. To avoid ...
0
votes
2answers
43 views

Check if user is logged in when clicking certain links on certain pages

On my site I have a number of post category archive pages. What I would like to do is set it up so that when links to specific posts are clicked on these pages the user is sent to the post only if ...
0
votes
0answers
21 views

paginate author-list in php [duplicate]

I've made an author list page template using the author boxes of starbox plugin. It works well displaying all authors in the right order but it shows even authors with posts that are drafted and not ...
0
votes
1answer
36 views

Apply filters when loading post via ajax

Have been trying to solve this for couple of hours already. Here's the case: I'm making a plugin that separates the posts into pages using the <!--nextpage--> tag. It works fine but I want to ...
0
votes
2answers
49 views

Upload images and attachments from frontend form

I'm not very expert of wordpress and I'm trying to create a frontend form sending information to my php function through ajax. I'd need help about uploading images and files as attachments of the post....
1
vote
1answer
36 views

Is there a way to get 3+ dimensional array from a single MySql command

For example an array that has all the months, inside each month are all the users registered that month, and details on every user. I could solve it by simply searching for all users registered this ...
0
votes
3answers
87 views

Integrating WordPress to my website, while keeping my own authentication system

I've recently integrated WordPress to my website and I've been trying to find out the correct way to replace Wordpress' authentication system with the one on my website. My website already has a user ...
1
vote
0answers
18 views

wp attempt focus, disabling without touching core

So i've added an extra field to the login form. I have used js to place it at the top. However, whatever I do I don't seem to be able to change the tabindex(or start focus for that matter. Is there a ...
0
votes
1answer
19 views

Adding an interior 'hero' area with some added php title customization

Ok here it goes. I hope Im at the right place. Sorry if this has been answered I looked over on the regular SO but couldn't find an answer. I'm currently building WP site that has a slider area on ...
0
votes
0answers
17 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
35 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
38 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
49 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
0answers
46 views

Adding a query string to product links

I need to add a query string to the end of the links generated by a [products] shortcode from WooCommerce. Each product appears with three links. The image, the title and the add-to-cart button. I ...
0
votes
1answer
29 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
17 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
56 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
148 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
22 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
28 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
41 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 */ ........
0
votes
0answers
59 views

Adding read more function through wordpress

First of all. I know wordpress has a read more function but that won't work either. Probably the same issue that's stopping me in the following. So i'm trying to create a read more function on my own....
1
vote
1answer
33 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
21 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
39 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
11 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
155 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
39 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
107 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
26 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
38 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
61 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
36 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
24 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
50 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
25 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 ...