Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [php]

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

0
votes
0answers
4 views

Meta query to fetch only latest post [on hold]

I know how to use meta query but can't setup query to fetch only one post by it's custom date field.
0
votes
1answer
5 views

Can't add to time?

What's the best way to add to time()? For example: time() + 5 will return 5, not the current unix timestamp with 5 added to it. Any ideas? Thanks
0
votes
0answers
10 views

Wordpress Answer Validation, Obfuscation issue

I have this issue, where I have made a function on my wordpress website (under Theme Functions.php), which then uses a shortcode to present on the front end. Now, I want to obfuscate the shortcode, as ...
0
votes
0answers
11 views

How do I make comment-reply-button with <span> that takes to comment reply form on click

I do need your help. I'm actually designing my personal blog's theme and I got stuck when I could not code a working comment-reply-button with span element. I know you must be wondering why with a ...
0
votes
1answer
26 views

Metadata on the WP_Post object

I need to retrieve custom field content from some posts. I'm currently using ACF and get_fields() gives me the result I need, but I'm wondering if it could be done natively. According to both a ...
0
votes
0answers
9 views

php multi value selection can handle two atrribut in one select

i want to ask how to add selection can handle 2 value in one choice example: in data student have 2 attribut id and name in selection box just visual name and if choice any name attribut id will ...
-2
votes
0answers
14 views

Please how do i build multi- level marketing software with wordpress [on hold]

please how do i build multilevel marketing software with worpress. Im trying to build a networking hierarchy with wordpress but im stock
1
vote
0answers
18 views

Can an array be used as a meta_query value?

I'm trying to query a custom post type (courses) by grade using WP_Query and Advanced Custom Fields (ACF). Grades (checkboxes) are organized by term (groups). Four grades per term, four terms per ...
0
votes
0answers
15 views

Php find date in meta_value between 2 date ranges

I want to search SQL database using PHP and look for meta_value. The meta_value contains data like this: "FixtureMatch_Id":"391270","Bookmaker":"1Bet","UpdatedDate":"2018-12-14T12:48:57.64"" So ...
-1
votes
1answer
16 views

How to import data including images from excel sheet

need to import data from excel sheet which have thousands of rows including image paths. Is this possible by using any plugin? Is there any other way to do so? Thank You.
1
vote
1answer
40 views

How do I create comment-reply-button using <span> element not <a>

I'm currently working to design my first WordPress blog and I got stuck when I came to code comment-reply-button because I want the comment-reply-button to be coded in span element only not a element ...
0
votes
0answers
13 views

Add to total price if product is in a specific category

I have 3 categories on my site (small-cars, cars, truck) and each category has a different formula for "extra miles": small cars (1 * field) (2 * field), trucks (2.5 * field). Like the calculation ...
1
vote
2answers
26 views

AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely

I have multiple wp_query's on the same page. Each one of those queries has an AJAX "read more" button at the bottom. The problem I'm finding is that I can only get one to work at a time. Whichever ...
0
votes
1answer
17 views

Add custom attribute to product's HTML to woocommerce cart page

I'm trying to add a data-attribute to WooCommerce's cart page. The cart page populates a table with each row being a product that has been added to the cart. I'm able to add a data attribute into ...
1
vote
1answer
25 views

Changing user_nicename

user_nicename has the same value with user_login. I want to change user_nicename value only by using code snippet into functions.php or wp-config.php. Is it possible without using phpmyadmin or any ...
0
votes
1answer
12 views

Multiple WordPress sites with different theme and plugin sharing the same content

I want run Multiple Wordpress websites with different theme and plugin using one database where the content remains the same in all websites. 1- site.com - Main site 2- siteb.com - Should use site....
0
votes
0answers
8 views

Where is php.ini in Windows Server 2016 installation [on hold]

I'm sure this is a ridiculously dumb question, but I have installed PHP (a couple years ago) on a Windows Server 2016 machine, and I can't find the php.ini file. I'm trying to change the ...
-2
votes
0answers
10 views

Please provide me code for update select query with for WordPress. I want to use with $wpdb [on hold]

Please provide me code for update select query with for WordPress. I want to use with $wpdb nd data how can i store data in db How i can embeded these code in my wordpress php file
0
votes
1answer
11 views

Using Wordpress custom post type to display StoryMapJS

So I want to use StoryMapJs on my website, and I want to be able to manage these via a custom post type. I've created a custom post type and fields for each option, but I'm struggling to get them to ...
0
votes
0answers
14 views

Change WooCommerce template for PDF - access to custom field

I want to do some modifications to a template of WooCommerce, but I'm rather ZERO in PHP, so that is why I'm asking some guidance so I could perform my small modifications, which I'm sure are not too ...
0
votes
0answers
17 views

Function not updating user_meta correctly when $current_time triggers

Hi all, I'm having trouble with my logic for the following function. I cant seem to make it work when it is supposed to, and how to override it when it is authorised to. The aim of the function is: -...
0
votes
1answer
19 views

Allow user to choose header style

I am working on developing a simple WP theme that our office will use as a starting point for any future projects that come in. My question is this: How would I go about adding functionality that ...
0
votes
0answers
14 views

function to generate custom field for Mailster newsletter from WPgens referral code

I’m quite new to WordPress – and coding in general except I did a lot of SQL, R Matlab etc during my studies a long time ago so I can learn if I know where to search :-). But php, javascript etc are ...
0
votes
0answers
7 views

WooCommerce: How can I select the catalog_visibility for a product?

I know, as simple as it sounds but I don't get it running: How can I select the product visibility for a product by his id via SQL? This is what I have: global $wpdb; $result = $wpdb->get_col( "...
0
votes
0answers
18 views

Error on Wordpress site: “an error occurred while processing this directive”. Have debug.log output available

Hope someone might be able to shed some light on this one. The error is very generic and seems quite unpredictable. Happens on some page loads, not others, and when it does, if you refresh a few times,...
0
votes
0answers
17 views

Require advice handling a URL redirect from a Third Party. URL Params need to populate and then forward to payment

I'm looking for some advice in regards to how I approach dealing with a redirected URL with params. I have a client, let's say Client #A. They have a WordPress website we previously created with ...
0
votes
2answers
16 views

Anyway to output the registration form like the login form with wp_login_form()?

I'm trying to create a dual login/register page with WordPress and so far I found out I can create my custom template and then output the login form with wp_login_form, however I cannot find any ...
1
vote
2answers
30 views

Self deactivate plugins after an action occurs

I'm developing a WordPress plugin. I want to download a file from a server, then unzip and put it inside the main directory of WordPress after the plugin is activated. The process of download and ...
-1
votes
0answers
10 views

Bootstrap not working [closed]

https://www.startutorial.com/articles/view/php-crud-tutorial-part-2 I based exactly here, but why mime doesnt work
0
votes
2answers
12 views

How to make this code valid only when the value exists?

very new here to php and wordpress coding (1 day lol). This is my code so far, the problem is that when there is no value assigned to this attribute I receive and error message. I know I need ...
1
vote
1answer
14 views

Custom page archive query by url var calling page twice on one of my custom queries?

This is such an odd issue. I will try and break it down as simply as I can. I am creating my own custom page query which works like an archive using url variables to customise the query results. ...
0
votes
1answer
15 views

Exclude category and post from loop in custom category.php

So I created a custom category.php where I have the following loop: <div id="category__product-grid" class="row"> <?php // The Loop while ( have_posts() ) : the_post(); ?> <div class=...
0
votes
1answer
20 views

Notice: Undefined variable: video_type

Hi how do i fix this error? Notice: Undefined variable: video_type wp-content/themes/multinews/framework/includes/post-formats.php 56 Here is the code. <?php } elseif ($video_type == '...
0
votes
0answers
24 views

How to get after hash word from current page url

I've been developing a filtering with mixitup including hash url filtering support in Wordpress. But one of the task, I need to catch up the after hash word and have to pass it into pure php string as ...
0
votes
0answers
20 views

How to display custom seo title before the loop?

So I've optimized one of my archive page title to this add_filter('wpseo_title', 'new_filter_title'); function new_filter_title($title) { if ( is_page('1637') && $...
0
votes
1answer
23 views

Wordpress mod_rewrite not working on php fpm

Today I tried to change the webserver to php fpm and it is really very fast But there is a very serious problem I found when I installed Wordpress, when I changed the premalink to anything but the ...
0
votes
0answers
7 views

Menu to the right of screen on desktop using Bootstrap 4

I'm fairly new to WordPress development and would love to learn as much as possible. I am building a theme from scratch and using the wp-bootstrap-navwalker (https://github.com/wp-bootstrap/wp-...
0
votes
0answers
12 views

show arabic posts on arabic page and show english posts on english pages using $wpb_all_query

I'm using this line to get all the posts with the category "Upcoming Event" $wpb_all_query = new WP_Query(array('post_type'=>'post', 'category_name' => 'Upcoming Event', 'post_status'=>'...
0
votes
0answers
16 views

Add custom URLs in yoast sitemap

I had a separated pages for each user in Wordpress like www.domain.com/user-profile/user/. How could I add these links in Yoast sitemap?
0
votes
0answers
19 views

WooCommerce get products based on the taxonomy

I need to modify the WooCommerce product query because I want to filter the shown products on the shop pages based on the taxonomies for each product. So what I've tried is this here: add_filter( '...
0
votes
0answers
8 views

How to refresh Parent Term List after creating a new category

I want to repopulate parent terms drop down once a new category is created. At least refreshing the current page is enough. I tried to hook into "create_category" hook also. I'm using custom post ...
0
votes
0answers
16 views

Can i use php phar to archive a wordpress plugin source files or few files only?

I want to secure main logic of my wordpress plugin. Only solution i got except encryption and obscurification is by making an archived file of my plugin source files via php phar but how and is it ...
0
votes
1answer
12 views

getting the values of hidden inputs to use them in a php mysql query

Im trying to update a value in the database, to do this I pass the values of the input an ID to another hidden inputs and submit the form via jquery, the values are set in the hidden input (tested). ...
0
votes
1answer
19 views

Detect what link user clicks and Redirect to a specific page for logged in users only

I have a link in my WP website Account link. I would like this to work normally for logged out users. However for Logged-in users i would like this link to take them to another page url. I have tried:...
0
votes
0answers
16 views

Showing siteorigin widget on category page view

I am using the plugin Page Builder by SiteOrigin and I am modifying my category page to render a snippet of one of my custom widgets inside the single view. How would i render just a specific widget ...
0
votes
0answers
6 views

How can I display all posts from child categories in the parent category?

I am trying to modify an existing website so that a parent category page displays the posts associated with both the parent and child categories. Currently, if there are any child categories, the ...
1
vote
1answer
28 views

How do I get current page ID in Wordpress customizer file?

I'm trying to hide or show customizer settings based on what page I am viewing similar to active_callback' => 'is_front_page', however, I haven't found a way how to access the current page ID from ...
0
votes
2answers
48 views

Unset session variable on page reload / setup but exclude AJAX

I'm currently trying to unset a session variable in WordPress if the page get's reloaded. I've tried a lot but it's not working like I want it. This is my function: /** * Unset filter session if ...
0
votes
0answers
10 views

Wordpress - Complex Forms

We have a very complex form on our website which is being generated using Formidable Forms (Pro version). It has a lot of conditional logic being used, and is very heavy in scripting as well as ...
0
votes
1answer
30 views

WP_Query To Display Product Of Brand On Taxonomy Page

I am trying to print all products of a brand on a taxonomy page. I find the wp_querry but i cant print the current brand name of the brand to show all products in this page. What to put on terms ...