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

learn more… | top users | synonyms (1)

0
votes
0answers
16 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
35 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
16 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
30 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
21 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
20 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
41 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
33 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
147 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
48 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
43 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
45 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
31 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
60 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
15 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
26 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
22 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
52 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
35 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
20 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
103 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
20 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
46 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
110 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
24 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
58 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
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
99 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
25 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
371 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
47 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
60 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
43 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
66 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
101 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
22 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 ...