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

learn more… | top users | synonyms (1)

0
votes
0answers
21 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
13 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 ...
-1
votes
0answers
17 views

input type text with metakey [on hold]

How do you create a custom field box with metakey associated on it? I have this metakey "word_srch" then I wanted to create an input type text that and whatever type in the input put, it will ...
0
votes
1answer
22 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
14 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
votes
0answers
16 views

Changing php version breaks login

I'm using wp_login_form within a custom widget on a website I am working on and it works great when I'm using php5.3. When I use anything newer, the login form stops working. My question is, does ...
1
vote
2answers
25 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
18 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
14 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
31 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
22 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 ...
0
votes
2answers
30 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
35 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>'; ...
0
votes
1answer
21 views

Trying to get php to echo height and width to use for overlay

Hey so Im creating this overlay for Wordpress and was wondering if there is a way I can echo the height and width as an inline style so that way the overlay can have the same height and width as them ...
1
vote
1answer
118 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
33 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 ...
-1
votes
0answers
18 views

Wordpress pagination why is this not working? [duplicate]

I got the following code: <main id="main"> <?php // the query $args = array('posts_per_page' => 2 ); $the_query = new WP_Query( $args ); ...
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
38 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 ( ...
1
vote
1answer
37 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
22 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
8 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
35 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
21 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 ...
0
votes
1answer
22 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
16 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
26 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
32 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 ...
-2
votes
0answers
13 views

How can I include Portfolio Posts in latest Blog Posts?

I've started building my Blog here: http://zweierlei-brei.de So my question is, how can I feature the latest Portfolio Posts on the starting page, with the same Layout as the latest Blog Posts, ...
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
23 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 ...
0
votes
1answer
15 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
31 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
45 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; ...
1
vote
1answer
69 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
votes
0answers
29 views

Breadcrumbs Not Displaying Parent

I made a breadcrumbs code with schema. However, the breadcrumbs only shows the home and child page rather than the entire hierarchy - it fails to display parent pages. Does anybody know what I might ...
1
vote
1answer
20 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
46 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
35 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
27 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
2answers
69 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
23 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
48 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 ...
-2
votes
0answers
18 views

Change custom post type taxonomy term based on post meta field value

I have a custom post type 'road_trip' with taxonomy 'tripstatus' terms 'upcomingadventures' (id 10) and 'completedadventures' (id 11). I already added to functions.php a function to assign all new ...
3
votes
0answers
38 views

Efficient coding: how to keep track of function stack?

I've written a plugin that calculates how much server time is required for each function in a theme or plugin. The idea is it will encourage developers to write efficient and green code. If you want ...
1
vote
1answer
26 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 ...