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

learn more… | top users | synonyms (1)

0
votes
0answers
4 views

PHP upload multiple files with different input field names using media_handle_upload

I'm trying to upload multiple images with different names from input fields on my WP site. The images will be attached to the post as metas. postThumbnail will be the post's featured image and ...
0
votes
1answer
13 views

Displaying Logged-In User Name in Wordpress Menu

I'm using Wordpress with UserPro, and want my menu to display the logged-in user's first name, linked to the user profile page. The problem is that in my menu structure, the "Profile" menu option is ...
0
votes
0answers
12 views

How to call javascript function (jquery) in a shortcode?

Before asking here, I've searched a while and found a tutorial about creating a wordpress plugin with shortcode and javascript calling. But I'm not able to make it work on my side. The tutorial is ...
-1
votes
0answers
9 views

Adding a payment methods to Memberpress

I'm using the membership plugin Memberpress, and I want to add another payment gateway. The website I'm working on is a football press website, with 2 subscription types. I want to add a ...
-1
votes
0answers
14 views

Resize an iframe dynamically with Wordpress resources

I have an iframe added by an Adsense custom search engine whose height is hard coded (inline) to 1860px and I can't change this, but the content height changes dynamically. This is how this iframe ...
-1
votes
0answers
6 views

Why repeated request?

what's wrong in the code? $terms = get_terms("category"); `enter code here`$count = count($terms); if($count > 0){ foreach ($terms as $term) { $t_id = $term->term_id; ...
2
votes
0answers
11 views

Is it good to always use the __($str) and _e($str) translate functions whenever there's a text that'll be going to output?

I'm currently developing a non-trivial theme right now, most of the time I'm not using a __($str) translate function when there's an HTML tag therein the text. Is it good to always use the translate ...
0
votes
0answers
8 views

Getting an array of parent menu links and titles and all children links and titles

I am developing a theme with wordpress and trying to develop a sidebar that changes based on the users menu selection. So if a user clicks on the 'Fruits' link on the menu and it has children menu ...
2
votes
1answer
36 views

Check if a user already voted

I'm writing a Wordpress poll system. I need to check if a user already voted, show him/her a message. But i dont know exactly how can i do that! One of my solutions is that to creating a table (named ...
0
votes
1answer
20 views

Add end mark at the end of every article

I'd like to insert an end mark like &#128282; 🔚 to every article I post. So I added it in entry-content.php like below. <section class="entry-content"> <?php if ( ...
0
votes
0answers
5 views

Query if audio attachment AND/OR custom field

I've been trying several things but to no avail... Searched, maybe not good enough though! I have posts that either have an uploaded audio file AND/OR has a Soundcloud link (which is a custom field). ...
0
votes
0answers
13 views

WordPress page condition on plugin activate

I'm trying to load diff. template on plugin state like on woocommerce pages and bbPress pages if ( class_exists('woocommerce') || class_exists('bbPress')){ if ( is_account_page() || ...
0
votes
1answer
26 views

Use WP_Query in shortcode

I'm trying to get meta information from the first four posts that have a meta key equal to Sedan, then format that posts meta in order to set up gallery type display boxes. I believe it has something ...
0
votes
3answers
20 views

Escape html structure in php

I have code like this: <?php echo '<div class="class-name">' . __( 'Text','text-domain' ) . '</div>'; ?> in a plugin of mine. Do i have to escape this? (esc_html or similiar)?
0
votes
1answer
21 views

How to get the term before the last from a custom taxonomy?

This code displays the last term added to a taxonomy "issue" which i use to automatically display a link toward my current issue: $args = array( 'hide_empty=0' ); $terms = get_terms( 'issue', ...
0
votes
1answer
10 views

On a custom template, should I use wp_footer? [duplicate]

I have started to learn about WP. I was asking myself the other day : should I use, in my custom template, the wp_footer() to call my scripts or should I go with static script? I can't seem to ...
0
votes
1answer
19 views

How to add div blocks after certain set of post

Ok I broke my post down into different style settings. Like shown below. The first post is a large block. the next four post are small and aligned next to the larger post. I used the loop below to ...
0
votes
0answers
7 views

Update title of every instance of widget using text field

I have created a simple widget which looks like this: As there are going to be many instances of this I want to know if it's possible to update the title of each instance (where it says 'Membership ...
0
votes
0answers
11 views

Wordpress: Trying to echo taxonomy slugs of individual downloads, but limit them to the $atts[category] selected from shortcode from post

Note: I'm a reasonable newcomer to .PHP, starting with this project. I understand the concept of it, but I'm not yet skilled enough to figure out what functions I need to use for something a bit ...
0
votes
0answers
20 views

how to use two permalinks for one custom post type

I have a custom post type "article" where posts have a permalink structure (www.mysite.com/article/post-name). I need each post in it to have two different templates according to its permalinks: the ...
0
votes
1answer
27 views

WordPress 4.2.3 on Windows Server 2008 R2 Creating Files as read only

Whenever I attempt to update a plugin or change my configuration for W3 Total Cache, if wordpress creates a new file, it's created with the Read Only attribute. I can upload and delete content without ...
0
votes
1answer
17 views

how to edit a specific post slug using a php code?

I want a php code by which i can show a modified link to the post. when using <?php get_post_permalink(); ?> it shows e.g.: (www.mysite.com/post-name-one). what i need is something like ...
0
votes
1answer
24 views

How to pass a PHP $_GET variable and fetch/output it?

I've already looked at the Wordpress Codex, and looked around for other solutions online, but i still can't seem to get it working. Basicly what i need is to pass a GET variable in an URL, and output ...
0
votes
0answers
13 views

Add custom filter to register data in array

I would like to register a multi arry of data in a plugin and allows any developper to add new value to the array. This multi array contains a name, and different value like this: class ...
0
votes
1answer
17 views

Front end post submissions do not get submitted in the category

If I submit the post after choosing a category the post doesnt get submitted and instead it takes me to the category page i have selected.However if i delete the fieldset "category" and fill the form ...
0
votes
1answer
26 views

WooCommerce “Checkout Now” button [on hold]

Okay so I want to add an additional button to the single product page that says "Checkout Now". This checkout now button should go directly to the checkout page, not the cart page (like the regular ...
0
votes
0answers
24 views

How to display terms from two taxonomies in one php code?

Two taxonomies were added to posts : volume : in which admin enter the number of the journal volume for each post issue : where admin enter the number of the issue under which the post is published ...
0
votes
0answers
13 views

Display the video of a post_format Video

I've a post with post_format = video, in which the content are a video and a text (in the default editor). I need to display the video and the text separately. How can do it? For now, I've this code: ...
0
votes
1answer
43 views

How to call post title and post summary to other part of site?

My blog is installed at /posts of my site. It's not a mistake; I wanted to be like that. But now my homepage looks somewhat empty. Here I want to call the title of my blog to my homepage, with a ...
0
votes
0answers
12 views

Custom Taxonomy Link Text Echo Name Not Slug

I'm a little lost about where I can place a simple php echo within a loop. I have a "program" taxonomy where each program is echoed onto buttons. Right now I'm only echoing the slugs for the link ...
1
vote
1answer
14 views

Adding regex filter to feedwordpress

I'm trying to write a plugin for Feedwordpress that filters html from the incoming feeds. So far I have managed to hook it to the right place, but the function completely wipes all content (and it ...
1
vote
2answers
27 views

Get date numerical and separate?

I need to work with date function but I want to get day and month numerical and separate and pass it to a function. For example, I want work for this function. function(day,month) How can I ...
-3
votes
0answers
14 views

nonhuman administration [closed]

Am searching for a plugins that help me to relate admin approval by a poll question answer (yes/no) to approve or disapprove a post of a member. I need the admin approval on posts automated.
0
votes
1answer
24 views

how to run a php code in widget?

I have a code to get all taxonomies and terms for a single post: $object_terms = wp_get_object_terms($post->ID, 'staff', array('fields' => 'all')); if ($object_terms) { echo '<p>' . ...
0
votes
1answer
26 views

How to add new css class [on hold]

I want to change one particular element. .stats-top .stats-number{ visibility: hidden; } There is one counter with 3 rows. I want the values from 2 rows not to be visible. When I try to add ...
0
votes
1answer
13 views

problem with category menu, it doesn't want to show link

I have created a category menu but when it displays in front page it shows just text without link. thats my code: $menuname1 = $lblg_themename1 . 'categorie Menu'; $bpmenulocation1 = 'secondary'; // ...
-2
votes
0answers
10 views

I need linkedin connection email addresss [closed]

I need linked in connections email address from php API, how can i get email address from linked in , if it possible can you provide me some details about code, i tried but LinkedIn API say that your ...
0
votes
0answers
20 views

Problem in sending data to server

I want to have a poll system in my new website. So i use the instructions here: W3Schools! with a bit changes. Now i have a hidden textbox:<input type="hidden" name="post_id" ...
0
votes
1answer
16 views

Find trigger behind occasional php undefined error

Trying to track down an error that's popping up in our php logs -- PHP Fatal error: Call to undefined function get_template_part() in ...index.php It shows up 2-4 times a day (while index.php ...
0
votes
0answers
17 views

Getting the ID of a category from a slug so I can search posts using ID

I am attempting to get the ID of a category by trying to search by the slug. I have tried a number of entries from this site and online but havent been able to return the ID of the slug. The slug is ...
-1
votes
0answers
19 views

need a good code for open and close tag wordpress editor [closed]

hi i need a good code for open and close tag wordpress editor 1.The button on first click shoud open and on second click have to close </b> tag 2.Add active class ! 3.How to ...
0
votes
0answers
46 views

Saving Post redirects to 404 page when php $_GET variable in post body

I am having a very annoying issue where certain posts redirect to 404 page when trying to save or publish a post. It only happens to a few posts and did not happen prior to the last few WP updates. I ...
0
votes
1answer
27 views

How to protect own PHP code from Wordpress updates

I have written several own shortcode scripts which I place in the shortcodes.php file. My Wordpress installation is set to update to new Wordpress versions automatically, which is a good thing. But ...
0
votes
1answer
15 views

resizes images on the fly

I'm looking for a plugin that resizes images on the fly that I can call via php. I have searched the wordpress plugins for something that does this and wasn't able to find anything that was up to date ...
0
votes
0answers
20 views

Cannot Enqueue JS Script in Wordpress Admin

I'm running through a tutorial to add some ajax functionality to the admin area of WordPress and have hit a road block. I've been trying for a couple of hours now and as far as I'm aware, the below ...
0
votes
0answers
18 views

Wordpress admin menu pages not receiving passed info

I have a Wordpress menu page (A) and a wordpress submenu page (B). I want to pass data from A to B. A has a list of items and I want B to show the details of each item, by passing the item id to it. ...
0
votes
0answers
9 views

502 Bad Gateway When Supplying Header Content-Length To Try To Force Download

I am trying to force the browser to download an mp3 when the user visits this site. The issue I am running into is if i set the Content-Length header the page throws a 502 Bad Gateway error, and if I ...
0
votes
1answer
24 views

Manually Create PHP Page For A Redirect

I am new to wordpress and working on something for a friend, I have FTP access, and am trying to upload a php file, that checks the platform and redirects the user either to the iTunes store if they ...
0
votes
0answers
11 views

When are static class variables shared? [migrated]

My understanding of PHP static class variables in a Wordpress environment is that, if 2 or more objects of the same class are instantiated within the same http request, then their class static ...
0
votes
0answers
9 views

customizing wordpress theme slider with switch statement

i am working on an assignment for wordpress , i need help in following matter, im using wordpress today news theme, the link of my current work ca.unitysofts.com in upper three slider , while ...