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

learn more… | top users | synonyms (1)

0
votes
1answer
11 views

Two menus show up

If I set 'echo' parameters value to 'true': <?php if( has_nav_menu( 'primary-menu' ) ) { wp_nav_menu( $menuParameters = array( 'theme_location' => ...
1
vote
1answer
18 views

Selecting specific posts with an if statement in a counted loop

I'm currently counting the posts in the loop... <?php $count = 0; ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php $count++; ?> ...
0
votes
1answer
45 views

Pass important values server-side when processing form

I am working on a plugin that has the following within a <form> tag: <input type="hidden" name="postid" value="<?php echo $postid; ?>"> The problem with this is that users can ...
0
votes
1answer
13 views

How to replace URL protocol using PHP?

I'm using HTTPS everywhere in my website but I have problems with sharing buttons for Pinterest and Tumblr. For example, when I try to share image on Pinterest I get this error: "Sorry we could not ...
0
votes
0answers
18 views

AJAX call keep sending message

I'm working on a form from front-end which inserts a post via AJAX. Everything works fine but when I opened chrome's console in the wordpress-admin menu and click on the specific post type it keeps ...
-3
votes
0answers
34 views

Echo inside if tag [on hold]

I'm trying to echo a value of an option inside 'if' tag, but it doesn't work. Here's what I want to achieve: $value = !is_home() // variable stored in an option if ( echo $value) echo 'not home' ...
0
votes
2answers
18 views

Disable Checkbox depending on state of another checkbox

I'm trying to disable a checkbox depending on the state of another checkbox. <form action="options.php" method="post" id="form_submission"> <table> <tr> ...
0
votes
0answers
15 views

How to create a php page to handle http request in WordPress

I want to have a page to handle the http request suck as xxx/app/api.php?id=7 and I create a php page in wordpress with redirecting by adding the following code to the end of the functions.php. After ...
1
vote
0answers
13 views

Trying to store submenu items to render out after main menu

I'm using a custom nav walker to render out the main menu, during this I want to store the second level navigation items to use/ render out later in a separate area of the page. I want these second ...
0
votes
0answers
13 views

Update table only if checkbox is clicked

I'm building a little home security project where it should be able to turn the system on/off from a website and by a password on the device. My problem seems to occur with the code from my website. ...
0
votes
1answer
32 views

Facebook php sdk 4 getSessionFromRedirect() always null

I have wordpress 4.1 with the following plugin installed: iThemes Security WordPress SEO I plugged in a function the facebook sdk. This is the code: //Footer add_action('wp_footer', ...
0
votes
1answer
17 views

ACF Unexpected T_CONSTANT_ENCAPSED_STRING [on hold]

I'm running the Advanced Custom Fields Pro plugin. When I implement the following code for the repeater field, I get this PHP error: Parse error: syntax error, unexpected ...
0
votes
0answers
13 views

No increments in counter in wp-query

I am trying to show related posts outside loop on a single custom post type post in an ordered list. I am using the below code but somehow it does not increment the numbers. <?php ...
0
votes
0answers
18 views

Wordpress search query

I used code snippet, from the plugin http://wpadvancedsearch.com/, which works very well, but when I press a search button, it generates the following string in the URL: /?search_query=& and I ...
0
votes
0answers
9 views

wp_title not showing for home page

ok so i tried this https://stackoverflow.com/questions/9055009/wordpress-wp-title-blank-on-index-page?answertab=oldest#tab-top and went to my function.php for my child theme and put the code in the ...
0
votes
0answers
24 views

Different ID in every shortcode

I am trying to make an Instagram-box on the author profile of my page. I need every profile to be different, and to do that I need to change the ID in my Instagram Widget-shortcode on every page. The ...
0
votes
2answers
23 views

Setting field not saving on front-end

I'm creating a theme option page and i try to display the values of two input in my front end : function register_my_header() { register_setting( 'header_options', 'header_options'); } ...
0
votes
0answers
12 views

Editing dashboard according to the userrole

I'm relatively new to PHP, I'm editing a plugin that restrict demo users with the role of (subscriber) from some capabilities, and it modifies the dashboard for the demo user(subscriber) and remove ...
0
votes
1answer
14 views

How to Display a List of Child Pages For a Parent Page in WordPress

I need to display child pages on my parent pages. i have a code that is working but i need to set some codes to only show specific pages like to only show visibility public not all the pages. this is ...
0
votes
0answers
19 views

Turn off Plugin Manually

I have installed and active wp-super-cache plugin, and It cached an PHP syntax error. I solved the error but can't run my website again because the error.log is still displaying the same error. I ...
0
votes
0answers
9 views

Avoid wp-load.php within a PHP/CSS file? [duplicate]

There was a similar question already but it uses ajax, and I am not. I want to have dynamic css in my theme, but I can't get the WP functions to work in my php/css file. In my functions.php file, I ...
1
vote
0answers
21 views

Media Upload , file name changed automatically

I face a problem that when i upload a video that named in non-english language , for example : Arabic , it placed in uploads folder with strange name Ùيديووو so it can't be access through ...
0
votes
0answers
9 views

Undefined offset from theme function with preg_match

I am trying to process ifttt [source_link] shortcode with function I found around. It works, but annoys in admin page with this error code: Notice: Undefined offset: 2 in /home/.../functions.php ...
1
vote
1answer
37 views

Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)

The Problem On a site I built, I opted to use custom fields instead of a calendar plugin to organize my posts in a "calendar". In the beginning this seemed like the most logical way to accomplish ...
0
votes
0answers
19 views

Using an iframe/plugin outside wordpress

I have Wordpress installed on my website, which I normally edit in dreamweaver. I use a few plugins in wordpress that are extremely useful; normally these generate their own page and I either use an ...
0
votes
0answers
14 views

Adding category in wordpress - custom

// Auto post ( Unique File Date ). $postData = array( 'post_category' => array( '0' ), 'post_status' => $Post_Status, 'post_type' => $Post_Type, 'post_date' => ...
0
votes
1answer
22 views

Problem adding class to body_class

I am trying to add additional classes to <body> based on certain conditions, so I have this code in my functions.php file of the theme : add_filter( 'body_class', 'custom_body_class' ); ...
0
votes
1answer
20 views

A Space being added to url generated by custom plugin

<?php /* Plugin Name: Convert Comment tag to link */ add_filter( 'comment_text', 'mh_commenttaglink' , 5000 ); function mh_commenttaglink( $text ) { // RegEx to find #tag, #hyphen-tag with ...
0
votes
0answers
9 views

Prevent multiple attachment with the same image

The plugin is designed to grab the user images from Instagram and insert them into media library, everything works fine on this part. I have set a transient with user selected refresh rate to check ...
0
votes
3answers
47 views

Execute a function every hour in the background

I'm in kind of a weird situation (for me) My client has a website that runs on a custom CMS He wants an online site that loads some data from the existing database. This is an external MSSQL database ...
0
votes
1answer
13 views

if has theme mod

Does someone know how to write the next line in wordpress PHP, because i'm not that great with PHP. If_theme_mode has content echo { my content } else { other content }; thnx
0
votes
2answers
12 views

Only load certain artists on this page

I have a wordpress page which loads all the artists in two columns... here is what I believe to be the relevant bit of code <?php global $paged; if ( is_front_page() ) { ...
0
votes
1answer
19 views

Nav-Menu not showing up

I would love for somebody to please help me because somewhere I am really miss understanding what WordPress is telling me. Alright so within my header.php I have the following code. <div ...
0
votes
2answers
25 views

How to add text to the start of all comments?

For example somebody replies- Hi! This is a Comment! but is published as Text- Hi! This is a Comment! Any ideas folks? I'm totally stumped. I want to add the extra text so it appears within the ...
0
votes
3answers
47 views

How to use return in my custom function instead of echo

I'm creating a function in functions.php with a custom hook, and from what I've read somewhere, it's good practice to return instead of use echo in a WordPress function? Correct me if I'm wrong. ...
0
votes
1answer
21 views

How to print redirected query string variables to the page?

I have a basic redirection set up: function example_add_rewrite_rules() { $year = '(\d{4})?'; $make = '([a-z]{1,20})'; $model = '(.+)'; add_rewrite_rule( ...
0
votes
0answers
28 views

Contact page won't send mail

I've installed a plugin for SMTP mail function. It works like a charm when testing, but my theme's contact page wont send mail. Here is the contact page template: /* Template Name: Contact */ ...
0
votes
1answer
24 views

TCPDF get_post_meta outside the loop

I want to be able to export a html page to PDF. I downloaded TCPDF (mainly because it allows me save High resolution images and shrinks the filesize.) The TCPDF folder is in my theme folder. If a ...
0
votes
0answers
17 views

auto post with custom date php wordpress

When i upload the image from wp_media, this below code runs: add_action('add_attachment', 'auto_post_after_image_upload'); // Wordpress Hook function auto_post_after_image_upload($attachId) { ...
1
vote
2answers
73 views

Converting HTML Template to Wordpress Theme

While I was trying to convert a Static HTML page to Wordpress Theme , I had an issue . the page Doesn't run properly After Checking Google Chrome Console it turns that it loads the CSS file with the ...
0
votes
0answers
24 views

Custom post type in theme page

I am having a problem with a website I'm currently working on. I am using the theme Html5-Blank by Todd Motto and Advanced Custom Fields for the content. The problem is this: I am using a custom post ...
0
votes
0answers
21 views

AdWords API with WP

Does anyone know a moron-proof way or guide to use the Google AdWords API with Wordpress? I can write PHP to a vaguely acceptable level. Just looking to populate a table with some basic live ...
0
votes
1answer
22 views

Sending email from inside a plugin using PHP PEAR

I have a plugin that I have developed, part of this plugin will hopefully to send emails with attachments. Before I started with Wordpress I did something similar with PHP using the PEAR class as you ...
0
votes
1answer
49 views

Dropdown filtering extremely slow

I have two dropdowns on my frontpage. The first dropdown selects a custom post type, and the second selects a location. The second dropdown is filtered based on the selection of the first dropdown ...
0
votes
0answers
60 views

Add title and caption to thumbnail image on mouseover

I'm trying to add a simple mouseover image to display the images title and caption data. I've added the js in my scripts file which is being called okay yet the rollover is not working. Essentially I ...
0
votes
1answer
20 views

Insert plugin content before body end

How do I make plugin's content appear in a place I want? For example let's say I have a plugin that output's a paragraph: echo "<p>foo<p>" If I do this it will appear on a page outside ...
0
votes
0answers
31 views

export high ress images to pdf

I want to export a webpage to PDF. I'm using the wp-mpdf plugin which is based upon mpdf. The problem that I'm having is that I want to be able to export a high ress image if that is on the page. ...
0
votes
0answers
10 views

Attachments doesn't update

I did use wp_attachments to display images from posts by url. With that in functions.php 'function twentythirteen_the_attached_image() { $post = get_post(); $attachment_size = ...
0
votes
0answers
25 views

custom function for wp_list_categories

I need to write a custom function for wp_list_categories so instead of displaying a hierarchical list of links they are instead a list of checkboxes with the parent terms being displayed as h3 tags. ...
1
vote
3answers
59 views

Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes)?

I am getting this error. I have increased the memory limit upto 512M. I have more than 4000 posts with so many data. Website is working fine. But when I am trying to access the custom post type page ...