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

learn more… | top users | synonyms (1)

0
votes
0answers
24 views

Add custom variable url to WordPress menu

I have a WordPress menu and would like to add a custom link. I know how to add a plain URL as a custom link but I am trying to add variable content and WP keeps stripping out some of the php code so ...
0
votes
0answers
12 views

Wordpress field group post

I am trying to pull images from a field group I created in Wordpress. First I created a new field group. I then created a new row with the name: witb-icons and field type: loop. Then I created a new ...
2
votes
1answer
125 views

Creating new menu item

I'm looking for a way to create a new item that can be added to a menu. Here are the details of my problem: I use WPML. WPML have that nice feature that you can add the switcher to a menu, ...
0
votes
0answers
36 views

add_rewrite_rule questions

I've read several tutorials on the subject, but am not seeming to be making headway here. Ultimately, I am trying to write the following url: example.com/parts/by_model/YEAR/MAKE/POST-NAME/# Where ...
0
votes
0answers
18 views

How to let users “follow/subscribe” tags (part is working)

I've searched for this for a looong time; My users should be able to follow/subscribe a tag than on a second front page, they only get posts from the subscribed tags. In the following example, in the ...
0
votes
2answers
27 views

How to write to a separate PHP file in plugin settings

I need a way of taking a variable from a plugin's settings and write it to a small key file located in the plugin's directory. The entire contents of the key file is this: <?php $transaction_key ...
0
votes
2answers
43 views

How do I turn a shortcode into php?

I need to add a shortcode into one of the php files (replacing a search bar code that is hardcoded into the header php file). How do I add a shortcode to the header php file? This is the code that I ...
0
votes
0answers
12 views

Posting from WP admin to another WP blog

I have 10 WP websites. One of them, or it can be any of them, but for simplicity , let's say that... one of them have a content (custom content type) that I want to post on 2 or 3 from others (the ...
1
vote
1answer
54 views

Check if a menu is empty?

I have menus set corresponding to a custom field on a page. Ie I have menu1, menu2, and menu3 on three pages under custom field => MenuName. Under functions.php I have: /* Add Menu Locations */ ...
1
vote
1answer
30 views

Custom field value not saving when it contains a URL?

I implemented a custom field into one of my post formats called 'url'. When I enter a random string of characters into the field, it saves just fine and I display it in my template like this: ...
0
votes
1answer
37 views

using wp enqueue style to create a CSS file specifically for a page template

I am trying to create a CSS file that only works for one page template. I am trying to do it using wp enqueue style but to no avail so far. I was able to get it to work (sort of) using the following ...
0
votes
0answers
25 views

Loop returns more items than exist?

Using the answer here: http://wordpress.stackexchange.com/a/207601/45709 exact works as it is intended. It returns 3 slides because only three slides exist. I had to slightly modify the code because ...
1
vote
1answer
39 views

How to loop over custom fields in a page template?

I was originally using a single field and things worked perfectly with the following code. Now I need to alter it to loop of several fields that are similar. To start: I've created several custom ...
0
votes
1answer
42 views

RegExp to EXCLUDE strip HTML (FOR SOMME) comments

I'm using this function to remove HTML comments from my code to save loading time: // Remove unwanted HTML comments function remove_html_comments($content = '') { return ...
0
votes
1answer
16 views

Slider from different widgets

I need some advice. I have added the possibility to pages to have categories with a plugin. I have created a widget for a client that lets a user select a category from a page and select a subpage ...
0
votes
0answers
27 views

Display custom post type with is taxonomy in homepage

I've a custom post type called "books". Inside there're many book that belongs to a custom category (made with taxonomy) selected by user. All of these books, made a carousel for each taxonomy in ...
0
votes
1answer
40 views

Enqueue less file not working in child theme?

In my child theme I have: add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . ...
0
votes
2answers
66 views

Formatting Shortcode to Display in Visual Mode

I was wondering if it's possible to convert this kind of shortcode: [card name="Muscle Band" set="XY" no="121" c="name"][/card] Into this in Visual Mode (in blue-colored text): Muscle Band XY ...
0
votes
1answer
21 views

Template code to split a post and print a custom field?

So I want a blog post but in the center of every blog post I want to split the content and print a custom field attached to the blog post type. Ie you field called "Blog Quote" and the user will ...
0
votes
0answers
41 views

strpos() expects parameter 1 to be string Error showing only in customizer

Whenever I go to customizer and from front page go to other pages(ex - right sidebar page), at the bottom of the page I get this error - Warning: strpos() expects parameter 1 to be string, object ...
0
votes
1answer
51 views

Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING

I installed the "Insert PHP" plugin in my Wordpress page, activated it, and put this code in my page: <p> Connection test </p> [insert_php] $mydb = new ...
0
votes
1answer
59 views

Gravity Forms merge tags in templates?

Is there a way to put Gravity Forms merge tags in template.php files or other sections of the website? A plugin maybe? I need to retrieve a field value from one of my Gravity Forms and use it in the ...
0
votes
1answer
23 views

wp_nav_menu doesn't work in a duplicate server

I duplicated my Wordpress installation to move to another server. Everything works find except one single file. I created a header-shop.php file to call a certain menu on my shop page. In the first ...
0
votes
0answers
53 views

Update Woocommerce price in product page

I opened price.php file and saw this: <p class="price"><?php echo $product->get_price_html(); ?></p> Ok but I want to put here a condition. if(empty($my_field)) { ...
0
votes
1answer
58 views

PHP Shortcode - 500 error

I have been working on a shortcode with help from this article: http://code.tutsplus.com/tutorials/create-a-shortcode-to-list-posts-with-multiple-parameters--wp-32199. I have tried to do what the ...
0
votes
1answer
42 views

How to properly send many mysql queries via php and what happens with ajax requests after they are sent?

I need to update the details of a few thousand accounts and I can't do it with pure MySQL, I need php too. With all the loops that's probably around 100k mysql queries. I chose to do it via a button ...
0
votes
1answer
34 views

Use html tags in shortcode_atts, is it real?

can i use html tags in shortcode attributes? like this: function b_text( $atts, $content = null ) { extract( shortcode_atts( array( 'text' => '<div class="myClass">DOM</div>' ...
0
votes
0answers
19 views

Add product of where price is based on # of items in cart

For a client I have to achieve the following: When a client buys a product he has the option to customize it. For one product the additional costs are $500, but when he buys more than 1 product, ...
0
votes
1answer
31 views

Using catch_that_image() for galleries?

I'm currently in the process of creating my first custom wp theme, in which the post contains the title, the content, the gallery, and also a div in between the title and content where as a ...
0
votes
0answers
14 views

Isolate Sub-Category from Top Category in WooCommerce Cart (Exclude others)

This is my first post to SOWD. I have the following function that adds custom fields for a given product category if present in the cart - in the example below, the product_cat is 123, which is a ...
0
votes
0answers
26 views

Simple modification for menu structure

I'm trying to make a menu for my website, but I want it to be easily modified through original WP menu(dashboard > appearance > menus). I want to add some small thing to the structure of my menu, ...
0
votes
0answers
85 views

Get and Display Content in wp_editor

I am building a simple plugin where I display a visual editor in the backend. My Code looks like this: $content = ''; $editor_id = 'ssp-editor'; $settings = array('textarea_name' => ...
0
votes
1answer
10 views

Storing content into a custom taxonomy

Currently I have created a custom taxonomy with the name "genre" and I am wondering how I can include it into the array for posting with the content from the string provided in the example. $my_post ...
0
votes
0answers
17 views

Meta Box not being added in plugin

I am attempting to create a simple oop plugin that registers a few custom post types and then adds meta boxes to that custom post type. It is currently adding the post type but it's not adding the ...
0
votes
3answers
44 views

Moving code from theme header to functions.php

Just wanted some advice in relation to adding some custom code to my wordpress site. I am using geoip to check a users country code and redirect them to the relevant site when they land on my ...
0
votes
2answers
83 views

How do I display Category titles on a WP Page?

I am trying to get a list of my Wordpress categories to display on a Page, but haven't cracked this yet. So far, I have been able to create a custom category page (category-categoryname.php), to ...
0
votes
1answer
30 views

Trying send mail from Theme page

I am trying tos end a mail and parse its contents using WP_Mail but the email is not sending im just not getting error message on the page. Can someone tell me if their is something wrong with my ...
0
votes
0answers
26 views

video preroll vimeo in wordpress

Hello guys I would like to integrate an open source code taken from github to my wordpress theme. link: Vimeo Pre-roll This is the code of my video.php, I would like to work with vimeo. code: ...
0
votes
1answer
35 views

Can form entries from a WordPress form go to a database

I am using Wordpress 4.3.1. I have built a stand alone form (form 1) using PHP where one can enter volunteering tasks doable in a city, has fields like volunteering activity, city, state. The values ...
1
vote
1answer
55 views

CPT + CMB2: data not displaying for only first post in loop

I've a CPT incorporating CMB2. I loop through every category and show each post within that category. My issue is that the first post in each category doesn't display certain info from two metaboxes: ...
0
votes
1answer
144 views

Print Woocommerce product price on cart page

I can access subtotal or total price via like this: $woocommerce->cart->get_cart_subtotal(); But I tried to $woocommerce->cart->product or $woocommerce->product->price then echo, ...
0
votes
0answers
26 views

How to retrieve value from Gravity Forms input and put it in template?

I'm trying to retrieve and input from my Gravity Forms form and put it into a template file. I know I have to use gform_after_submission but I am not sure what I am doing. This is what I have so far: ...
0
votes
0answers
62 views

Use URL query string in img src attribute

I'd like to display images of my custom fonts on my (private) WordPress site. The font-creation website I use, FontStruct, has a URL-accessed tool for rendering a line of text in a specific font. ...
0
votes
1answer
47 views

PHP Warning: Missing argument 2

From ajax Im updating a custom user field and visualising proper content using a shortcode. localising jquery function localise_jquery1410() { wp_enqueue_script('jquery'); wp_enqueue_script( ...
0
votes
2answers
42 views

How do I put the homepage link inside the php _e code?

How do I put the homepage link ? Right now it's not correct. <p><?php _e( 'The page you are looking for is not here. Why don’t you try the <a href="<?php echo esc_url( home_url( ...
0
votes
1answer
18 views

Why BuddyPress fields not saving?

I have a Wordpress+BuddyPress site. I added some extra fields in user profile. When i registering user i fill all fields on register form. After i do redirection in user profile: function ...
0
votes
1answer
21 views

Parsing Menu Items and Blog Posts

Question 1 I'd like to be able to show or hide certain pages in the main navigation menu based on whether or not they have certain prefixes in their title. This is mostly for the purpose of language ...
0
votes
0answers
38 views

Include ACF field in other plugin option page

I'm using Advanced Custom Plugin. I can get the field's output via export option. My field like this: if(function_exists("register_field_group")) { register_field_group(array ( 'id' => ...
2
votes
2answers
136 views

Display 4 chronological posts starting with a random post

I know that I can display 4 random posts by doing something like: get_posts('orderby=rand&numberposts=4');   What I'm trying to achieve is starting with a random item, but then showing ...
0
votes
1answer
82 views

There is no existing custom fields' value in functions.php

I'm using WooCommerce and Advanced Custom Fields plugin. I have a function for calculate my product's discount, like this: function woo_add_cart_fee() { global $woocommerce; $discount = ...