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
6 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 ...
-1
votes
0answers
5 views

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

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
7 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
4 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
11 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
18 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
17 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
14 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
29 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 [on hold]

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
19 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
22 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
0answers
17 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
11 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
18 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
18 views

How do i show a background image in inline css in PHP? [closed]

<div class="featured-img" style="background-image:url('images/uploads/stry-teer.jpg');"></div> New to PHP. The image was showing okay in pure html but now I'm converting to php how do I ...
0
votes
0answers
14 views

How to create a custom DOM event? [closed]

How to create a custom js event that fire a GTM trigger. im using Ninja Popup plugin and i need to fire a tag when a user subscribe through the newsletter form on that popup, luckily that plugin has a ...
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
46 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
16 views

How to customise in my code to change the color of posts [closed]

How to customize in my code to change the color of posts. I want to post programming codes. But I want only the codes to change color and other texts remain in black. But they all turn black. So ...
0
votes
1answer
29 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 ...
0
votes
1answer
23 views

Register non hierarchical taxonomy and the show meta box in the post type

I am trying to show a meta box in my product post type, but I'm getting this warning error... Warning error... Warning: call_user_func() expects parameter 1 to be a valid callback, no array or ...
0
votes
0answers
13 views

Mysqli connect not working with PORT parameter

I have a problem with mysqli connection. When I do it this way: $link = mysqli_connect("localhost:3306", "admin_xxx", "password", "admin_xxx"); It's not working and gives error: Error: Unable to ...
1
vote
1answer
16 views

Integrating PHP into Javascript to display map markers with Google API - problem with wp_localize

I would display Google maps markers on custom site temple with Google API maps. I do everything like this post: Integrating PHP into Javascript to display map markers with Google API But a console ...
0
votes
1answer
24 views

Why File_exists returns true with or without ABSPATH?

I've been confused due to the result being true in both cases, with or without using ABSPATH constant for this: if (file_exists(ABSPATH . 'wp-config.php')){ echo "true"; } or if (file_exists('...
0
votes
1answer
20 views

Post source link plugin - small modification

I'm using a little plugin that allows me to add source link to every article. I found the code in this thread: Article source link for posts It's almost perfect, but I need to make 2 little ...
0
votes
0answers
20 views

WooCommerce filter shop page without any plugin via AJAX

I've build a fancy dropdown filter at the top of the WooCommerce shop products list: The list gets filled from a custom product meta called hardness. It can has 3 values: big, middle and small. The ...
0
votes
0answers
34 views

enqueue script adds another .css with same name?

First I apologize if I'm not clear but I'll try to explain my problem with my enqueue script. I am trying to build a WP theme (conveting HTML & CSS Website) with existing files, but when I try to ...
0
votes
1answer
17 views

Update an additional user meta field with a string

I have created a WordPress website. In the user section I have created an additional attribute called "Token" meta field. Every time a new user is created or a user logs in and is validated, I would ...
0
votes
1answer
21 views

How WordPress core manage the plugin installation

I'm learning about wordpress plugin creation. I've found very useful the documentations found on wordpress codex about this argument, but I've a question: How the wordpress core manage the plugin ...
0
votes
0answers
10 views

regarding the multilang. capabilities of wordpress: how to use them?

hello dear Wordpress and experts, just a question regarding the multilang. capabilities of wordpress: how to use them ? just planning a new Webseite with different languages WordPress offers ...
-1
votes
1answer
16 views

Getting custom field data from cart page to checkout page in woocomerce [on hold]

Added some text fields to add for whom we are sending the gift by adding their name and personal message as well.For Personal message it is working fine If i add To field and click on proceed to ...
0
votes
1answer
8 views

Show the section only if custom taxonomy was chosen

So I have a code where all items of my custom taxonomy ('colour') are displayed. I broke my head trying to show the section ("colour__chart") only if one of taxonomy items was chosen. In simple words, ...
1
vote
1answer
29 views

Update PHP version 5.3 to 7.2 or first WP 4.7.11 to 4.9.8?

I am not sure if I am better of by upgrading WP to 4.9.8 when my PHP version is still on 5.3 or do the other way?