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

learn more… | top users | synonyms (1)

0
votes
0answers
16 views

Must use Plugin not updating HTML code in head

I am trying to insert code in head tag through MU Plugin. I don't know why head tag and init is not updating by using add_action('wp_head', 'my_function') and add_action('init', 'my_function2'). My ...
0
votes
2answers
15 views

PHP: Showing currency sign if input is a number

I have a field that lets me enter a price for a product in 'edit post'. Here's how it's currently called: <span class="price"> "$" <?php echo get_post_meta(get_the_ID(),'si-price',true); ...
0
votes
1answer
16 views

Displaying text if post was within 5 hours

Currently I have the following string. $timeago = human_time_diff( get_the_time('U'), current_time('timestamp') ); print $timeago; This returns results that looks like this. 1 min, 1 hour, 1 week, ...
0
votes
1answer
23 views

Run JS Code on userlog out

I'm trying to delete a variable stored in local storage when user logs out of WordPress, none of the two code blocks below work for me, both have been tested in my functions.php file one at a time. ...
0
votes
0answers
17 views

Javascript attr href not appending parameters on WordPress site

I have this exact code set up and running on a regular HTML/PHP site but when I tried setting it up in WordPress, it doesn't work. The code itself works, the Javascript is present when I view the ...
0
votes
0answers
9 views

comments sorting incorrectly across multiple pages

This is a related_comments.php file which should display comments on certain pages in ascending order while the newest comment should be at the top. This is working fine if there is only one page for ...
0
votes
0answers
24 views

Add multiple filter using preg_replace_callback to image tags in single post

Im successfully using the following code (without plugin) in my functions.php to defer load my images in the single post content ($content) area. function filter_defer_loading($content) { return ...
-2
votes
0answers
22 views

Broken e-mail link in header

I had a working e-mail link in my header but since I've activated my w3 cache-plugin it stopped working. I'm guessing I could fix it in an .php file somewhere, but I don't know where. The site is ...
0
votes
0answers
12 views

Custom Gallery HTML only returns #carousel output and not #sliding ouput

I took the following code from an example and adjusted it so a standard gallery in wordpress would output as a Flexslider and Carousel. I can output one of them just fine, but I added additional ...
0
votes
0answers
22 views

Custom WP Admin pages do not display after trying to add child to functions-admin.php

I am building a theme options page. I have a parent page with 3 sub-pages under that. Volcano (Parent) Sidebar Theme Options Custom CSS The Problem: All of these settings are not displaying at ...
0
votes
1answer
15 views

New walker for walker_nav_menu to change inside container data

I'm not really good with coding, but I have googled a lot and edit some script and it worked, but I can't achieve what I need. This is the code: class description_walker extends Walker_Nav_Menu { ...
1
vote
0answers
18 views

Check if page parent has certain template

I want to check if a page has a parent with a certain page template attached to it. If I know that I can determine which scripts to load or not. Normally I would just get the page template and if it ...
0
votes
0answers
7 views

Related Posts from String

Currently I am using a code I randomly found on the internet but I am trying to piece together how I can make it pull the $artist string I have set instead of pulling the tags. $tags = ...
0
votes
2answers
20 views

Wordpress Multiple Navigation bars

This is more of a 'Is it possible question" I have a home page which has a full width header and a transparent Navbar, when you scroll this Navbar changes to white. On all my other pages I want this ...
0
votes
0answers
23 views

Email not sending on wordpress

I am trying to send custom email using ajax in wordpress but it's coming back with 500 internal server error on form submission. Can anyone help me out with this concern <script ...
0
votes
0answers
17 views

Enable/disable code in functions.php with options

Is there a way to enable or disable lines of code in a themes functions.php file? Basically I would like to have a page in the admin panel that lists "modules" or separate php files and has the ...
0
votes
0answers
19 views

Access a WordPress Table from Outside Project

I have a PHP project on example.com and I have a WordPress installation on example.com/blog. I need to get data for my PHP project from one of My WordPress table. Is it possible? If it is possible ...
0
votes
2answers
25 views

Call global variable array() in woocommerce child/template

So I have this in my functions file - it defines the products that are not eligible for free shipping. It works everything is fine. //functions.php function my_free_shipping( $is_available ) { ...
-2
votes
1answer
29 views

Javascript code not working - $ is not a function error

On redesign out web site we wanted to add the slick js carousel function on the homepage. Followed the instructions to the slick javasriprt website http://kenwheeler.github.io/slick/ but it does not ...
0
votes
0answers
13 views

How to recreate post form on a custom PHP page.

I need to have my users be able to post pages on a custom php page, not through the standard Wordpress menu. Therefor i'm trying to recreate a form that can post just like the Wordpress 'add post' ...
-2
votes
0answers
13 views

How to get Fpdf,html2pdf or Dompdf get work in Wordpress custom template?

Im working on a project to let html input change into a pdf file. I know that are these working pdf programms, but how do i put it in Wordpress and let it work in there?
-3
votes
1answer
32 views

Please help! Parse error: syntax error, unexpected '<' in blog code, no idea how to fix it! [closed]

This is currently the code: <?php //* Start the engine include_once( get_template_directory() . '/lib/init.php' ); //* Enqueue scripts and styles add_action( 'wp_enqueue_scripts', ...
0
votes
0answers
26 views

Position banner to right of logo in header - messed up my header file

Hi I made a mistake by editing my header.php file before backing it up and now having trouble getting it right. There's just a <div> tag missing or something but I am spinning my wheels so maybe ...
-2
votes
1answer
34 views

Messed up my header.php file trying to position banner

Hi I made a mistake by editing my header.php file before backing it up and now having trouble getting it right. There's just a or span tag missing or something but I am spinning my wheels so maybe ...
1
vote
0answers
11 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
27 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 ) { ...
0
votes
0answers
30 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
49 views

Wierd site output [on hold]

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
1answer
44 views

Parse error: syntax error, unexpected end of file in functions.php on line 487 [closed]

After seeking a solution about thumbnail size, I found in wordpress codex some codes and when i add them in editor in function php my blog stopped working. It is a blank page with this error message : ...
0
votes
1answer
33 views

How do I filter an array after I've already created a foreach loop? [closed]

I've written a "foreach loop" to "echo" ALL of the images i've uploaded in Wordpress' media library. However I need to be able to select all the images in a certain folder. (i.e /thisfolder). I ...
0
votes
0answers
25 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
10 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
22 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
41 views

How do I correct the code in php? [on hold]

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
15 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
23 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
32 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
24 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
14 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
4answers
69 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 ...
-2
votes
0answers
13 views

Classifieds theme: create a report this listing feature

I am running a classifieds site on WordPress. I would like to have a "report" or "flag" feature on the listings that makes it so that people can flag inappropriate listings and they go to my "pending ...
1
vote
0answers
8 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
22 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 ...
1
vote
1answer
32 views

Redirect to another page not working

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. But ...
-1
votes
0answers
22 views

How do I put a slider within a post loop?

so i know the title is a bit vague, as I couldnt accurately describe my issue for the title. You can kind of see what im goin for with this snippet if( 10 === $woocommerce_loop['loop'] ) { echo ...
1
vote
2answers
24 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 ...
-1
votes
0answers
15 views

Problem with loading posts

I'm using a plugin to load more posts onclick called "ajax load more". Here is my standard code for echoing out posts: <div id="content"> <?php query_posts('showposts=3'); if ...
3
votes
1answer
60 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
17 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 ...