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

learn more… | top users | synonyms (1)

0
votes
2answers
21 views

How to check if a string is a valid URL

WordPress provides a helpful function called is_email() which checks if a given email address is valid. Is there a similar function available to check if a URL is valid? I tried is_url() but that was ...
-4
votes
0answers
8 views

Can I get the checkout form into a template? [on hold]

Hi I am using woocomemrce and was wondering would it be possible to get the checkout form and payment stuff onto another page? I want to create a template which will have a single product on and the ...
2
votes
2answers
40 views

How to search display_name column when using WP_User_Query

I'm using WP_User_Query to bring back a list of users. According to this article, I can focus the query on particular columns (I'm assuming in the wp_users table) using the search_columns param. My ...
0
votes
1answer
14 views

Next post link on a bootstrap button

Seems extremely simple but it doesn't work. Here is my code: <a href="<?php next_post_link(); ?>"> <button class="btn btn-default pull-right"> <span class="glyphicon ...
1
vote
1answer
65 views

Get the title before comma

I am using this code to return the title of the post on a gravity form field. add_filter('gform_field_value_page_name', 'page_name_filler'); function page_name_filler($value){ return ...
0
votes
1answer
28 views

display specific widget to a page

im trying to display a specific widget i need for the header current im using a code to display all widgets but my problem is that if I add additional widgets it will destroy my site. ...
0
votes
0answers
20 views

Install will not load: PHP does not have MYSQL installed

I'm having trouble installing Wordpress on my Windows 2008 R2 server. I'm getting the message: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. To ...
-3
votes
0answers
9 views

How can I Stop woocommerce messages appearing on archive? [on hold]

I have created a custom template which pull in product from two specified categories however when I add one of the products to cart no message will appear at the top of the page however if i go to an ...
-3
votes
0answers
17 views

Wordpress script to automatically get and post news feed [on hold]

Please, does anyone have ideas on how to make a script to automatically post contents from urls I have set in it and post them on my site? Is there a plugin for that? I would have to work more like a ...
0
votes
0answers
11 views

Show value based on dropdown [duplicate]

I am trying to create a short code with a form I have the form displaying ok but I need to be able to pull the price information from sql table as well and show it in a label. How can i do that using ...
0
votes
0answers
20 views

select option with value count

i'm early for wordpress and php code. so, i have post type property with type ( apartment, house, villa, etc ). example, for type apartment any three property. but on select option, be like this : ...
0
votes
0answers
9 views

Tweak CDN linker plugin to work with multisite subfolder set up [on hold]

The CDN LINKER PLUGIN unfortunately does not work with a multisite subfolder set-up. On the mainsite the plugin works great. Please do not recommend other plugins like w3 total cache - no appetite to ...
0
votes
1answer
13 views

Sort posts by custom fields value using dropdown menu

I'm trying to sort my posts by a custom field value, called price. Only using numbers in the custom field value. I want that the visitors of the website can sort the posts on price by using a ...
-1
votes
0answers
14 views

Embed Gravity Forms on external site (not WordPress) [on hold]

I have a Gravity Forms (contact form) on my main WordPress site. Each form submission is stored in the Gravity Forms WordPress Backend. I would like to embed that form on other sites (not WordPress), ...
4
votes
1answer
23 views

How to create a test that calls is_front_page in phpunit?

I'm using WP_UnitTestCase but in my code I have this condition. is_front_page which I'm not sure how to simulate that in PHPUnit This is the piece of code that I have elseif ( is_front_page() ) { ...
-1
votes
0answers
16 views

How to add size attributes to wordpress ACF image loop? [on hold]

I am simply trying to use a medium thumbnail size for the background-image in my advanced custom fields gallery. I am fairly new to wordpress and understand conceptually what I need to do, however I'm ...
-1
votes
1answer
12 views

Convert ACF checkbox choices to links [on hold]

I'm using ACF (Advanced Custom Fields) to create a checkbox on a custom post. Does anyone know if it's possible to turn those checkbox choices into links? For example: Checkbox Results: ~ Red ...
1
vote
3answers
51 views

Change behavior of the <!--more--> tag

When I click "read more" at the bottom of one of my website posts, it just loads the rest of the text in the same page and the same section, thus overflowing elements with text and spoiling my layout. ...
0
votes
0answers
21 views

Radio buttons value not calculated and div not displayed on button click event

I have a list of index and in each index I have 3 fields indexno, indexname and parts. parts is parent and has sub fields partno, partname and partvalue. Each part is displayed as a radio button. ...
0
votes
0answers
10 views

get adjacent post by meta key and meta value

I'm trying to limit previous/next navigation to posts that have the same meta_value on a certain meta_key. I know this was asked before, but I couldn't pick a working answer. And all that I could come ...
-1
votes
1answer
16 views

Like/Dislike plugin crawler problem

I'm making new plugin where users can vote like/dislike my posts. But i have a problem with this plugin. Crawler bots can vote, and i don't know how to prevent it. Vote links have no follow, but i ...
0
votes
1answer
20 views

Show custom field if it exists, and show different elements if it doesn't

Basicly what I'm trying to do (with very basic knowledge of PHP): If Custom Field $randomname exists for that particular post, show the content of that custom field. If Custom Field $randomname ...
0
votes
0answers
14 views

How to edit plugin to only display on specific post types, instead of all posts and pages

I've installed a plugin (allows users to save favourite posts to a list: http://goo.gl/9LEvjy ) but by default it displays on all posts and pages. I want it to only display only on posts, NOT pages - ...
0
votes
0answers
7 views

Adding canonical tags manually to a page in wordpress

Hi Stackexchange community, I have a wordpress site where I have a main page for courses and a page for workshops. I want to add canonical tags on the workshop pages because most of the content on ...
0
votes
1answer
21 views

meaning of (array)function()

I saw this piece of code that have part of the code I never saw before. What is the behavior of (array) in this scenario? so far I know the way of creating arrays in php never see this. // ...
0
votes
0answers
8 views

Custom post type pagination [duplicate]

I'm trying to get pagination for a custom post type. I don't know what's wrong with the code but it doesn't work. This is what I have done so far: <?php $query = new WP_Query( ...
0
votes
1answer
36 views

How to pick “full/thumbnail” images in the loop?

I am picking the latest posts through the WordPress loop using the below code, but it's picking all images at full size: if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> ...
0
votes
1answer
39 views

How to call plugin path in JS?

I am using wp-store-locator plugin and I want to add plugin directory path to my JS. html = "<li data-store-id='" + id + "'><div><p>" + storeImg + "<strong>" + store + ...
-1
votes
0answers
25 views

Polylang language switcher drop down not working [closed]

i have this polylang language switcher plugin on my site 2 of the shortcode works but for the drodown its not working. <?php // WORKING ?> <ul><?php pll_the_languages(); ...
0
votes
1answer
45 views

CPT Repeatable Fields + Undefined Index

I'm using this code here for repeating fields in a CPT (yes, I know of ACF and a few others), and have tried to add a third field. The field is currently displaying in the meta box, and is output on ...
0
votes
0answers
21 views

Manipulate database of WordPress site with my own scripts

I love WordPress as it provides plenty of great themes, good SEO and overall content management. But I'm not always happy with WordPress's original "Add post" and "Edit post" features as it required ...
0
votes
0answers
33 views

Autoloading a PHP class – working outside, but not inside WordPress plugin

I am thinking about using autoloading in a plugin. Outside of WordPress (as a test) it works as expected, but inside the plugin there are some problems. The directory structure I used for testing: ...
0
votes
0answers
20 views

How can I correctly POST to a Wordpress page?

I'm creating a timetable page for a community-run bus route planner/timetable site, and I'm currently coding a page where the user can select their desired bus from a drop-down list, and then PHP will ...
0
votes
0answers
32 views

How to show the wordpress post on grid format? [closed]

So, I used below code for showing the grids of post on wordpress. <div id="gridcontainer"> <?php $counter = 1; //start counter $grids = 2; //Grids per row global $query_string; //Need this ...
1
vote
0answers
99 views

WordPress Liveblog plugin: How to associate uploaded images with comments? [closed]

I'm using Automattic's Liveblog plugin which is also available on GitHub. Background When a user uploads an image, the following happens: a new post of post_type 'attachment' is created. a new ...
0
votes
1answer
21 views

WordPress custom field images not getting inserted into array

I am using Wordpress to create a dynamic gallery using Bootstrap. I created a new custom field and then set it to 'images' and then assigned it to my post type. It then shows up in my post, I uploaded ...
0
votes
1answer
35 views

Why isn't the canonical link element used for all pages?

The canonical link element isn't set for all pages. For example, if I look at the source code for a post, I can see the following in the <head>: <link rel='canonical' ...
0
votes
1answer
19 views

Modify php code to pass a page id as a parameter in order to create a breadcrumb

I use a function to create the breadcrumb in my pages and it works: function the_breadcrumb() { $currentBefore = '<li><a>'; $currentAfter = '</a></li>'; if ( ...
0
votes
1answer
22 views

Load slideshow.css file only if Slideshow is checked / on

I use <?php if ( get_option('mytheme_slider') == 'checked') { get_template_part( 'partials/slider/slider-java-script' ); } ?> to include the slider-java-script.php template part into my site. ...
0
votes
0answers
12 views

Possible to remove settings from wp_customize?

So, really basic setting here. function Ari_customize_register( $wp_customize ) { $wp_customize->add_setting('header_position', array()); $wp_customize->add_control('header_position', array( ...
0
votes
1answer
19 views

If tag equals then show else show

In my WordPress I have a page template called: single_jobs.php In the template is shown a contact formular. Linked in the template file like this: <?php echo do_shortcode( '[contact-form-7 ...
0
votes
0answers
29 views

Global Variables Reset After Form Submit Wordpress

I am making a spam prevention program by randomly generating sums to answer. When I try to access the value after the form submits, it does not exist. I declared global variables inside function.php. ...
0
votes
1answer
27 views

media-uploader insert into post is not inserting

I have created a plugin for custom logo and its working fine, but when I tried to add this functionality into my exiting theme options its not working. I have this js code. ...
1
vote
1answer
19 views

WordPress update_post_meta updating with empty meta_value field [closed]

I'm usuing custom fields pluging and my code has to fill them automitcally, everything works fine except 2 strings: The way i'm getting the fields: foreach($postMeta as $key => $dataTmp) ...
0
votes
0answers
13 views

Modification to admin bar Site Name does not change from one network site to other

The wordpress admin bar has a 'Site Name' section, that when clicked takes you to the dashboard if you're on the front end, or vice versa. The sitename code for the admin bar can be found in ...
0
votes
0answers
18 views

How to correctly add the featured immage (thumbnails) support in a WP theme? Why I can't add a featured immage?

I have developed this custom WP theme: http://www.asper-eritrea.com/ As you can see into the post excertpt (in the home page) it is showed the first immage into my posts. To do it I use this code: ...
0
votes
0answers
12 views

Wordpress hook to add content under title or post status buttons on edit.php

I'm looking to add some content above the wp_list_table for a custom post type. I have custom bulk actions and filters but would like to add some further content to this header area. I cant seem to ...
0
votes
2answers
27 views

How to make blog post entries appear as input form instead of just text?

I want my blog posts to appear inside of a form input box instead of just text on a page. Not the title, but only the submission. Is that possible. My index.php: <a href="<?php the_permalink() ...
0
votes
0answers
9 views

Splitting of Page

I have opted to go with a single page layout with custom fields. However is becomes tedious to scroll down the page to edit content at end. As such I would like to split the page into smaller parts. ...
1
vote
1answer
31 views

Remove wp_admin_bar fail on wordpress 4.0

The following code is out of date, can anyone help me update this code? if ( !current_user_can( 'manage_options' ) ) { remove_action( 'init', '_wp_admin_bar_init' ); }