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

learn more… | top users | synonyms (1)

0
votes
1answer
45 views

How to solve 404 permalink errors on nginx server

I can't solve this issue. I tried everything I found over the web. I first tried configuring my nginx.conf following the example on codex with no success. https://codex.wordpress.org/Nginx I found ...
1
vote
1answer
85 views

Load a page into a div with Ajax

I'm really a noob when it comes to Wordpress, right now I'm working on a theme that basically is all static, if you want to edit something you'll have to edit the .php file than rather doing it on the ...
1
vote
1answer
33 views

How to get post's current parent term ID?

How do you get the ID of the parent term of the current child term assigned to a post. For a custom taxonomy? Custom taxonomy: "location" Countries Japan USA Mexico Cities New York Austin ...
-1
votes
2answers
29 views

Load files content [closed]

I would like to load a css file in my Wordpress plugin by php. First I tried file_get_contents: $stylesheet = file_get_contents(plugins_url('assets/css/fonts.css', __FILE__ )); But than I get this ...
-1
votes
1answer
18 views

Adding logo to Wordpress header

I want to add a logo to my header for a website im building, where in this code would I put the image URL? The theme im using in Bones. <!doctype html> <!--[if lt IE 7]><html <?php ...
0
votes
1answer
33 views

Wordpress archive page showing 404 Error [duplicate]

This is the code for an archive page on my website, when I try to open this page, it brings up a 404 error and doesn't display any content. Is there a problem in this code that is stopping it? I am ...
0
votes
1answer
32 views

Print out Wordpress user ID - two sites with same code but different output

Trying my luck once more with more smarter and awesome peeps =D In my last question the issue was regarding getting wordpress user ID, which worked perfectly after someone steered me in the right ...
-1
votes
3answers
34 views

Using PHP for background-image property [closed]

I'm building a gallery page for a website and want to use the images from post types as background images with lightboxes. The code im using currently is this: <div id="primary" class="content-...
0
votes
1answer
27 views

How to get the filename from file system and create a download link?

I have a custom page template. This template have a custom form, the user can upload a file in that form and input his/her personal infos. The file will save in the file system. I want to create a ...
0
votes
1answer
43 views

Get wp_current_user_id using PHP and MySQL

awesome people of the Stack Community! Like the newbie coder I am, it took many hours but at last I got: a HTML form inside wordpress -> to submit value to MySQL database -> and then store the ...
0
votes
0answers
24 views

Conditional display of author name with image

Just redesigned my site (well, ok “purchased a new theme” as opposed to me redesigning it) and wanted to be a bit fancy. Using the code below, which I used (and it works) in widgets, wanted to ...
0
votes
0answers
15 views

auto metakey value on post tile

I have this metakey "word_srch" the metakey has no value, i have to input the value in the custom field in the backed, instead, how can i create a function code that will automatically input the value ...
0
votes
1answer
30 views

wp_redirect only works on main site and not on other sites

My main site is https://www.domain.com/, all my multisites will have https://www.domein.com/multisite1/ link. I made a function in functions.php which will check if the option (in the admin panel) is ...
0
votes
0answers
15 views

Transfer custom post nav (prev/next) from one to another theme

I bought two themes and just want to assume a special next/prev post navigation from the first theme in the second theme. I've searched the theme files and found the function, which declares this ...
1
vote
2answers
28 views

Part of title duplicating but not sure how to remove from code - help?

I inherited a problem that no one in my office can figure out. Our company website has page titles in the format of "Page Name Company Name - Company Name." The first instance of Company Name is a ...
1
vote
1answer
20 views

Wordpress Search Results for Multiple Post Types

I want to show both posts and attachments in the search results. Basically, I need something that says if the post has a thumbnail, show it. else show the attachment image (since they don't have ...
0
votes
1answer
19 views

Calling PHP Titles inside Javascript Markup

I have a video gallery, and all the titles are generated by php. They are coming from my Wordpress media library's attachment titles. The lightbox for these videos, however, is customized in ...
0
votes
1answer
17 views

Subheader title depends on post - change to static

On site I have subheader, which always display last post title. I would like to have in this place static title, like "Blog" or "News". This is the whole code of subheader: <?php $output = '...
1
vote
2answers
37 views

Add custom HTML to posts page

I want to add a header image via some custom HTML to the posts page but can't edit it with the pages menu in Wordpress. Is there a way to add the HTML in the specific PHP-File and which PHP do I have ...
0
votes
0answers
24 views

Post information from plugin to static page Wordpress

I'm writting a plugin to Wordpress and i need to post an information from date base to static page. I do it by shortcode. Here is an example of plugin function code: function show_list_oil_filters($...
0
votes
2answers
32 views

Is this Wordpress code causing page weirdness? Can't scroll to bottom

I have the code below on my homepage to list posts from a specific category, then a second piece to list posts from across the site. The problem I'm having is that there is some sort of weirdness ...
1
vote
2answers
38 views

Output array into one table cell

I'm trying to output an array into one table cell. Here is a truncated version of what I have now: $prerequisites = get_post_meta($post->ID, 'opl_prerequisites', true); $output .= '<td>'; ...
2
votes
1answer
132 views

WordPress Shortcode and Dynamic CSS

I have a question I would like to ask to the WordPress developers, Usually when creating a shortcode that need to generate custom css how do you proceed? For example a simple button shortcode with ...
0
votes
1answer
47 views

Meta box not saving

I am following Noel Tock's tutorial on making an Events CPT and so far I was able to show the custom columns and the custom meta box. The problem now is that I cannot save the data inside the meta ...
0
votes
1answer
41 views

Some links broken after updating Wordpress version

first post on here so go easy :) got a problem with a wordpress site (custom theme) http://expressduplication.co.uk which was built a few years ago by a company we are no longer able to get in touch ...
0
votes
0answers
27 views

How can I add pagination to my loop? [duplicate]

That's my current loop: <main id="main"> <?php // the query $args = array('posts_per_page' => 10 ); $the_query = new WP_Query( $args ); ?> ...
2
votes
3answers
42 views

Wordpress loop specific thumbnail size

That's my loop: <main id="main"> <?php // the query $args = array('posts_per_page' => 10 ); $the_query = new WP_Query( $args ); ?> <?php if ( $the_query-...
1
vote
1answer
41 views

How can I add pagination and how can I change thumbnail size?

I'm currently learning wordpress development and I try to add pagination which displays a "older"/"newer post" link and the number of the current page at the bottom of the posts. I also try to change ...
0
votes
1answer
28 views

Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge

So I am using jQuery and pHp together to send an email to myself whenever a user clicks on the update button of their Ultimate Member form. However, the email only sends when a user is using Chrome, ...
0
votes
0answers
9 views

Using Custom Fields to Create Post Tags

i have a wordpress blog with 25k+ posts that contain a Keywords custom field i found this code to Create Post tags based on custom field value but its not work on bulk edit: function ...
0
votes
2answers
42 views

List all categories but exclude current post category on single post page

I want to display a list of categories excluding the category of the current single post that the user is navigating on. The list is displayed on the single.php template. I'm using this code to ...
1
vote
1answer
22 views

Custom category code not showing all posts

I have a PHP template I am applying to several pages on my site so that they show a list of all posts in a category with the same name as the page. However, this is not working correctly in that posts ...
0
votes
0answers
13 views

Can't get post meta from custom post type metabox

I use Ajax Load More - Infinite Scroll plugin for output custom post type. I have custom meta box link_to with value /something - it's just link. In template of plugin i try to get it <a href=...
0
votes
1answer
24 views

Can't get data from audio media

I am trying the get the data of an audio, I've uploaded to a Wordpress site I'm working on (Not my own). I'm quite new to WordPress, but as far as I know, media files such as images and audio is ...
0
votes
1answer
20 views

How to replace the default domain on wp get shortlink

<?php echo wp_get_shortlink(); ?> When using this line you will get mydomain.com/?p=1. I was wondering if I can change my domain like myalternatedomain.com/?p=1 while using this code?
0
votes
3answers
40 views

Ajax Load more CPT via shortcode

I have a problem with ajax load more for my CustomPostType. I think i have mistake but don't know where. If it possible to edit my code, i will happy. UPDATE I have create div cool to paste in it ...
-3
votes
1answer
33 views

Please help to know why single.php crashes after I add this code [closed]

This is my single.php. I'm using the Suffusion theme and the Advanced Custom Fields plugin. I'm trying to display custom fields based in a specific post category. The code works fine if I remove the ...
0
votes
0answers
19 views

Echo multiple tasks if a common function exists

How can I echo multiple tasks if a common WordPress function exists. For example, I want to reduce the following: <?php if (function_exists ('pluginName')) echo someName (1); ?> <?php if (...
1
vote
1answer
59 views

How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]

I have a section on my front page that displays the top 4 most popular products from my Woocommerce shop. I is located within a div as such: <div id="trending"> <p class="trending-title"&...
0
votes
1answer
19 views

Static home page ignored

I am trying to show an static page instead of posts. It is defined accordingly in Settings-Reading, and it works fine. It uses a front-page template. But activating Polylang (since my web should be in ...
0
votes
1answer
41 views

How to remove coupon dropdown feature

I want to remove the coupon drop down feature and just have the input field and 'add coupon' button on the checkout page. Does anyone know how I can get rid of the dropdown feature? Thank you in ...
0
votes
0answers
46 views

Add post order to function

How to add post order to this function? I would like to display most recent post from newest to oldest: <?php //Establish first post check variable $first_post = true; query_posts('category_name=...
1
vote
1answer
97 views

Upload Image in a Wordpress page using PHP

Hello awesome people of SE! :) Okay, so this is a little far-fetched but I'm trying to get a HTML form with a PHP upload script to work inside a Wordpress page. I can't use a plugin. It's supposed to ...
1
vote
1answer
21 views

Count the number of times the search form template gets included on a page

I've got a template that has a search form in several locations. Each search form is identical, containing a text input, two radio buttons, two labels associated to the radio buttons, and a submit ...
0
votes
1answer
56 views

How to add aria role and schema markup to custom walker container

Edit: after doing some research I've found that in the wp_nav_menu function uses the following code to display the containers value. if ( $args->container ) { /** * Filter the list of ...
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 ...