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

learn more… | top users | synonyms (1)

0
votes
1answer
18 views

Add a custom class to the body tag using custom fields

There are certain posts where I want to manually append a custom body class to using custom fields. How do I go about it appending the class to the body tag when a certain custom field is added to a ...
1
vote
2answers
57 views

Hide a menu-item and its submenus and display a 'Log in' link if the user is logged out

I need, somehow, to enable that when you logout, that 'My Account' item is getting hidden from the navbar, and instead it displays a 'Log in' link. The item 'My Account' also have submenus with the ...
0
votes
1answer
40 views

How to insert a single row to WP database table?

Intro: I have a function that handles a contact form variables in my website. user enters name, email and text. function.php gets variables using javascript. I get more information on the user ...
0
votes
0answers
16 views

Including Custom Field in RSS Feed with IF Statements

I'm trying to customise my RSS feed as some of our wordpress posts have a custom excerpt that needs to be separately pulled into the feed. I've included the code I'm trying to implement below to pull ...
0
votes
2answers
44 views

Logic on a Gravity Forms redirect [closed]

I'm setting up a series of questions and based on the answers, I am trying to redirect to a specific page. For one example, the questions have to be answer correctly, they need to be male and 65 or ...
0
votes
1answer
16 views

Even with PHP plugin get_posts not working in widget area

I have the following code in a template, it and displays images form a custom field: <ul class="about-us-grid"> <li> <?php $posts = ...
0
votes
2answers
22 views

Switch-Case and user_role

I am trying to create a page that shows all users with a selection of details. One of those details is the user role it has. For each role I want to display a different string. In order to achieve ...
0
votes
2answers
35 views

Facebook like update status for wordpress

I am new to wordpress and i am learning a lot. But i am making this intranet site and i need to make a form just like Facebook's update status where my logged in users will need to update their status ...
0
votes
0answers
51 views

how to use custom form field values in email - woocommerce

I am using following code to add a custom field to woo-commerce registration form. After registration is done. I am saving generated activation key to wp_users table. By using that custom field value. ...
0
votes
0answers
19 views

How to create a custom post type that contains another custom post type?

I want to create a custom post type 'A', which will contain multiple post types of post type 'B', and custom post type 'A' is a series of post type 'B', so I'd like the edit page of post type 'A' to ...
0
votes
2answers
29 views

Retrieve data from multiple Wordpress sites using PHP script

I want to run a PHP script that iterates over WordPress sites found in a certain folder and read the plugins info per each site using get_plugin function In the code below, I try to require API ...
1
vote
1answer
20 views

multiple taxonomy select display only one in front end

I have various custom taxonomy, sometime, I have multiple choise selected in the back end ( cf screenshot) however, in Front end, I have only one getting display, I would like to have all of them ...
0
votes
1answer
25 views

wp_query with cat not working

I am trying to retrieve some custom post type from their specific parent category. <div class="tab-content"> <?php $cat_menu = get_categories('taxonomy=menu_categorie&type=menus'); ...
0
votes
0answers
47 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
32 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
1answer
57 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 ...
0
votes
0answers
18 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 ...
3
votes
1answer
79 views

Check if a user already voted [closed]

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
27 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
10 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
17 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
33 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
29 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
29 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
11 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
63 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
14 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
14 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
26 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
40 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
26 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
50 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
21 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
24 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
32 views

WooCommerce “Checkout Now” button [closed]

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
25 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
46 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
16 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
27 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
32 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 ...
0
votes
1answer
30 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
16 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'; // ...
0
votes
1answer
18 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
21 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 ...
0
votes
0answers
56 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
40 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
19 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
32 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
22 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. ...