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

learn more… | top users | synonyms (1)

1
vote
0answers
25 views

Adding a widget function into the php theme file

I am using the following plugin - widget No Cache AJAX Widgets to display on the sidebar a feed of rss news that is created dynamically and bypassing the cache function. In updating the site we wish ...
3
votes
1answer
34 views

Wrap each shortcode in array to div

i'm trying to wrap each shortcode in div with special data attributes, but when i'm using nested shortcode they don't wrapped, where i'm wrong? thanks public function wrapShortcode( $content ) { ...
1
vote
0answers
74 views

Displaying recent posts on static page with template-part via shortcode

So, I'm taking my first shot at creating my own custom Wordpress theme with Underscores. I have everything straightened out, with the exception of one last thing I want to add. I would like to add a ...
0
votes
2answers
52 views

Wierd site output [closed]

I'm quite new to Wordpress, I've build a website and found out in the Google WebMaster tool that one of the most present keyword was [%%LINKS%%]... I've found this code: <div ...
0
votes
0answers
21 views

Multiple simple wordpress sites (different domains) on a single installation

I am running WordPress on Google App Engine, and for a variety of reasons I want to have several domains served from a single installation. (tl;dr for why is that these are basically brochure-ware ...
0
votes
0answers
37 views

Notice: Trying to get property of non-object

I got the notice on this line : $team_options[$category->name] = $category->slug; $team_categories = get_terms('team_types'); $team_options = array("All" => ""); foreach ($team_categories as ...
0
votes
1answer
18 views

Wp Debug Enabled True Notices and Warning

Notice: Undefined index: Zumpito_event_full_day in /home2/michael/public_html/domainname.com/wp-content/themes/themename/included/main.php on line 246 Warning: Cannot modify header information - ...
0
votes
0answers
39 views

Cannot get custom links to show using wp_get_nav_menu_items

$args = array( 'post_type' => 'nav_menu_item', 'post_parent' => $id, 'orderdby'=> 'menu_order', 'output' => ARRAY_A ); $childs = wp_get_nav_menu_items( 4, $args ); ...
0
votes
2answers
45 views

How do I correct the code in php? [closed]

I am new to PHP and I'm unable to solve the code. It's showing an error. <?php function thumbImg() { if ( has_post_thumbnail() ) { the_post_thumbnail( array(54,54) ); } else { ...
0
votes
0answers
17 views

migrating user and passwords from jshop to wordpress

Hi i am migrating from jshop to wordpress so i also want to migrate old website users but there passwords a encryted using md5($string.$salt) method but then if i add user to wordpress database then ...
1
vote
1answer
30 views

How to echo text in browser instead of download junk file?

I have a custom plugin that was developed for me a while back and I'm trying to tweak it's action and fix a slight bug. Based on certain conditions, the plugin presents the user with a custom ...
1
vote
1answer
40 views

WP Query with custom Shortcode

I have the following in my functions.php:- /** * Shortcode: Latest Properties */ function latest_properties_func( $atts ) { $args = array( 'posts_per_page'=> 5, 'post_type' ...
0
votes
1answer
27 views

Twentyfifteen style author comment

I am using twentyfifteen and I have made a child theme. I am trying to style author comments differently than visitor comment. In other words I want the author replies to have a black background. ...
1
vote
0answers
38 views

Update user profile information from functions.php

I have the following function in my functions.php file:- function apply_for_job() { $job_id = $_GET['job_id']; $user_id = get_current_user_id(); $prev_value = get_field('applied_jobs'); ...
2
votes
3answers
104 views

Trim first 2 words of the exceprt

I am currently pulling in the post excerpt however there are 2 words at the start of it that I would rather not have in this particular place as there is a title already. I have used wp_trim ...
1
vote
0answers
10 views

auto-populating custom nav with all items from custom post type

I have written the following code to take all of the posts in my custom post type "products" (created with ACF) and inject them each as an <li> in a custom nav menu. Everything is working ...
1
vote
0answers
28 views

add_action shortcut?

I think in PHP 5.4 or above (don't remember the exact version), instead of writing: function some_function() { } add_action( 'init', 'some_function' ); One can pass an anonymous function: ...
1
vote
0answers
48 views

PhantomJS with wordpress

I know it sounds basic but I'd really appreciate some help/guidence on how to use phantomjs on my wordpress project. I'm using Windows 8.1 and local host with xampp for now. I've downloaded phantomjs ...
0
votes
1answer
60 views

Redirect to another page not working SOLVED!

I have a custom page template (1 file only, contains with CSS, HTML and PHP) with a form and it will send an email after the user click the submit button and it will redirect also to another page. ...
1
vote
2answers
28 views

Custom theme: Alternatives to long list of 'include' in functions.php

I'm building a custom theme for in-house use only. I started by putting a lot of the core functions in plugins, but then that seemed silly since they don't require any user interaction. Next, I put ...
3
votes
1answer
80 views

Displaying post per day

Currently I have the code displayed below. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12"> <a ...
0
votes
0answers
18 views

Wordpress Custom Post - Default Order in Admin

Here is my code. add_action('pre_get_posts', 'pre_get_kurs', 1); function pre_get_kurs($query) { if ($query->is_main_query() && ($orderby = $query->get('orderby'))) { if ...
1
vote
1answer
27 views

If post has custom field then display css-class

I would like to display a different icon in an i tag if a post has a certain key of a customized field. In my example Preis: <i class="(get_post_meta(get_the_ID(), 'Preis', true) != '' ? echo "fa ...
1
vote
0answers
34 views

Dynamically change feature image in customiser

For this client's Website I am making on their homepage there is a section called featured products with images showing off the product. Currently I have to update these images manually through my ...
0
votes
1answer
50 views

How to change <html lang=“bg-BG” , but only for one page

I spent last 4 hours searching for an answer how to change html lang="bg-BG" to html lang="en-GB". I already reviewed the old topics, and it seems that define ('WPLANG', 'xx_XX'); is not working ...
1
vote
1answer
31 views

How to use copy() function and paste file in /wp-content/themes directory

copy("http://localhost/medium/theme.zip","themenew.zip"); currently it is pasting file in wp-admin folder, Is there any way I can copy .zip file to /wp-content/themes directory. Thank You :)
1
vote
0answers
33 views

WordPress Quick Question . How to Get Parent Link in Submenu in My Code

I'm creating a menu walker from foundation 6 but problem is parent link is not click able, so solution might be that if we can get parent link in submenu but have some problem because I'm don't know ...
-4
votes
1answer
38 views

How do I link the side images?

This is my site: http://classichits.ie/ I want to link the background image to another page. This is the code I have so far: body.boxed-layout { background-image:url(<?php echo ...
0
votes
1answer
27 views

form built dynamically with php, not submitting

On one of my wordpress admin pages, I am building a form to add new mailers. I have it checking the templates mysql table and building the list of available templates, then also giving it the option ...
1
vote
2answers
42 views

Commenting out unwated CSS/scripts in HTML with PHP

I am trying to comment out unwanted CSS and JS files to prevent them from firing in the HTML by creating a simple function in my functions.php. So far I have: function commentStuff() { $stylesheet = ...
0
votes
0answers
34 views

Keep getting PHP memory error

I'm building my custom menu on my WordPress/WooCommerce site and I'm only about 20% done with the number of links I need on the menu. However, now I just get a PHP memory error when I try and save ...
1
vote
0answers
37 views

Get the date of the className or classID

Is it possible to get the date of the class name or class ID? I just used the following to get the date of the post, but there are image galleries and each image has a different upload date: echo ...
0
votes
1answer
34 views

Renaming “Expand Details” within “Add Media”

I was wondering if it was possible that the "Expand Details" option via "Add Media" can be renamed? I couldn't find a guide online so I thought I would ask here for guidance, (that's if it's ...
1
vote
2answers
47 views

Custom plugin: Trying to show saved data on frontend

I'm working on my first plugin and I have made a nice settings page which saves and works. But I have split it to few files and now I can't determine if field is checked.. I have also tried ...
1
vote
1answer
80 views

How to run PHP code in Text Widget with no plugin in WP 4.4

Before I had the following code in the function.php add_filter('widget_text','execute_php',100); function execute_php($html){ if(strpos($html,"<"."?php")!==false){ ob_start(); ...
1
vote
0answers
132 views

Importing Product Variation Images Swatches

I want to upload several thousand variable products to Woocommerce using the WP All Import plugin. I also want to display product variations using the Color or Image Variations Swatches plugin, which ...
0
votes
3answers
41 views

I installed Wordpress locally now how do I login?

I downloaded a WordPress website that I am modifying for a friend. He gave me access to cPanel, where I downloaded the SQL and changed it on XAMPP. Now when I open >localhost/wp it opens the ...
0
votes
0answers
19 views

Upgraded to WooCommerce 2.4, single product page is dying after displaying title

This issue started when I upgraded from WC 2.2 to 2.4. I just upgraded to 2.5 and I'm still having the issue. For some, but not all products the single product page dies after displaying the post ...
0
votes
2answers
91 views

Post to WordPress from another Server via PHP

I have running a wordpress site on - lets say - "site.com" and another site "input.com" hosted in completely different locations. As the name suggests, "input.com" should be used as a input site with ...
1
vote
0answers
15 views

How to assign a customer to an order?

I have a problem assigning a customer to an order using a php script. Is it even possible? I know, that it is possible to get the customer ID back from the order, but I can't find a way, how to set ...
0
votes
0answers
24 views

2 different Home Pages for different language url part

I'm in trouble with multilanguage site I would to have for all pages under url www.example.com/EN An EN HOMEPAGE and for www.example.com/IT another HOmePAGE. How can I dot this? I already know this ...
0
votes
1answer
18 views

Querying for specific tags

I currently have this code that pulls all of the tags and creates a list with links for them: <?php $tags_array = get_tags(); foreach( $tags_array as $tag) : $tag_link = get_tag_link( ...
0
votes
0answers
45 views

Lazy loading Ajax offset not working

I am attempting to create a lazy loading ajax feature on my site. There is a 'click more' button which will then load 10 posts via ajax and append them to the HTML container. I want to display 10 ...
0
votes
2answers
48 views

using the_permalink to echo an href into a <li>

I'm trying to make a menu that automatically populates from a custom post type I have and I'm having some trouble getting it right If someone could point me in the right direction I would greatly ...
0
votes
0answers
32 views

#1062 - Duplicate entry '1' for key 'PRIMARY'

I am trying to move my database from my usbwebserver to my online server. But I get this error, can anyone help me with this? #1062 - Duplicate entry '1' for key 'PRIMARY'
1
vote
0answers
20 views

Output custom field value to post string

I am trying to get a custom field called "u-courseid" its a field that was created by a theme plugin. My goal is to output the value of this field after the post name. So the output would be " Post ...
0
votes
1answer
48 views

Accessing an image via ajax

The goal with this is to create a random banner, managed in the wp admin. I can create a banner solution in the wp admin without an issue but need a little help on the ajax side. I have an image ...
0
votes
1answer
10 views

Get posts associated with media attachment

Is there a good way to find all posts that contain a specific image? I'm working on the attachment single template, and I'd like to list the posts that contain that image.
1
vote
1answer
219 views

Remove Woocommerce product link

I'd like to remove the link from the Woocommerce product listings. I don't need the user to see the product detail pages, we are going to use Quick View instead. Anywho, I have been searching and ...
0
votes
0answers
30 views

Count of Custom Attribute - WooCommerce

I would like to put a a message to say "available in other colors" on the category page if there is more than one color you can select on the product. Right now I have some code in content.product.php ...