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

learn more… | top users | synonyms (1)

0
votes
0answers
17 views

How to add navigation links at the top of image browser slider in NextGEN Gallery plugin

Here's the image browser template code: <?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?> <div class='ngg-imagebrowser' id='<?php ...
-1
votes
2answers
54 views

Trying to prepend a Hashtag symbol to the_tags links [closed]

I want to prepend a hashtag (#) in front of the tags on my post pages in Wordpress using jQuery. This code is not working: $('div.tags a').prepend('#'); This is the php: <div class="tags"> ...
1
vote
1answer
121 views

How to loop through JSON data in wordpress WP REST API

I am using the WP REST API plugin in wordpress and want to loop through my json data using a for each loop, however when I var_dump the variable that the json data is stored in it gives me an error. ...
1
vote
1answer
30 views

Attach previously uploaded image to post - current code has unexpected results

What code currently does: I feed post id & previously uploaded image id, code processes it all and does its magic described below. Result: unattached old image and new attached image. What I ...
1
vote
1answer
32 views

Get the last month with posts using a recursive function…

There is probably another way but I would like to understand why this code returns null... I only have posts in october and here's the recursive function: function last_post( $month,$year ) { ...
0
votes
1answer
11 views

Link to page with posts of specific type

This might be a stupid question, but I am having difficulty finding an answer on google. I have a section of my site that loads 4 divs with a post title, excerpt and 'read more' link to the full post. ...
2
votes
2answers
91 views

Initiate only latest version of a class

We have a class which is common to few plugins that we develop. As time goes we improve the class and add new functions so we have class variable which is the class version. Because multiple plugins ...
0
votes
1answer
54 views

Call to a member function add_rewrite_tag() on null

After reading this I started moving my CPT (namely "evento") to a new plugin (it was in a Bones-based theme before). The new plugin is basically a fresh WP Boilerplate Plugin folder, where I just ...
0
votes
0answers
22 views

Accordion Menu not being called

I'm trying to add a vertical accordion menu to my custom theme, and I have no idea what is not working. The original tutorial is here : http://cssmenumaker.com/blog/wordpress-accordion-menu-tutorial ...
0
votes
2answers
61 views

How to place login logout link on menu that redirects users back to current page?

I am working on an area of my site for members. However, I need a link on my menu that when clicked it will take people to my login form then back to the page they were previously on. I need the same ...
0
votes
0answers
37 views

I want to query for the 'post' and 'attachment' in wordpress using SQL query

How do I write a SQL query which will allow me to query for the 'post' and 'attachment' at the same time in MySQL? I am trying to get this information from the wordpress 'Posts' table. Please see my ...
0
votes
1answer
60 views

I can't fetch query parameters ($_GET parameters) with get_query_var

I am developing pagination for a list of posts in my plugin. I've added a custom parameter in my plugin_functions.php file: add_query_arg('pworkspage', 1); As you can see it defaults to "1". Now, ...
0
votes
2answers
70 views

Use wordpress plugin in codeigniter

It's possible to use a wordpress plugin in other framework than wordpress like Codeigniter ? I want to use wordpress booking calendar ( https://wordpress.org/plugins/booking/ ) in a website built ...
0
votes
0answers
26 views

WooCommerce add to cart

Why can't my variation product be added when user not logged in? Here is the link. I use this: function add_custom_product_meta() { global $woocommerce, $wpdb; $item_id = ...
0
votes
1answer
40 views

Order a WP_Query by meta value where the value is an array

I have a WordPress custom query: $args = array( 'posts_per_page' => 2, 'meta_key' => 'pworks_popular_posts', 'paged' => $page_nr ); $query = new WP_Query($args); ...
0
votes
0answers
24 views

Pagination in plugin's backend

I am displaying a list of posts in the plugin backend but I can't seem to get the pagination to work. I used the standard approach of getting the "paged" variable and then passing it to get_posts()'s ...
0
votes
0answers
28 views

Setting API - Default values for options when active the plugin

I have registered two options called test33_header_logo and test33_advertising_code. I need to set default options(test33_header_logo="logo1",test33_advertising_code=123456" when activate the ...
0
votes
2answers
46 views

php - Plugin/theme relative PATH/URI

I would like to get relative path from a php file without knowing the absolute path. I have succeeded to do it but for a reason which I don't know, on some servers (in rare case) it doesn't work when ...
0
votes
1answer
18 views

WordPress Setting API - There is no field in options.php

I am creating a small WordPress plugin. I created setting page and there are two user inputs in setting page. I created two option types. Those are rmpm_post_newcount and rmpm_post_newname. After ...
0
votes
0answers
18 views

Pagination redirection in WordPress

I had a blog website in a custom CMS. I recently re-developed the website in WordPress. The old website had pagination urls like "?page=2" But WordPress shows pagination urls like "/page/2" Now what ...
0
votes
1answer
26 views

How to use functions [closed]

I have installed the plugin WPdeposit on my site, it allows users to deposit into their account balance. I am trying to manipulate users balances when they press an anchor tag on the page. In the ...
0
votes
1answer
32 views

Rewrite Most Wordpess URLs

I have a wordpress site that's approximately 25% "business" pages and 75% "techie" pages. The current site: mysite.com, I'm splitting into two separate domains: mysite.com for the business stuff and ...
0
votes
2answers
39 views

PHP Output also in Child theme, but different

I have a multilingual site setup: www.jeroenbrugman.com The main dutch version uses Fluxus. On the artwork page I output a link using this from Functions.php function prefix_term_name($terms, ...
0
votes
2answers
31 views

Wordpress cron is running with previously set time intervals and not the updated one

For testing purposes I keep short time intervals for cron and when the functionality is working fine, I change it to the required time interval. Whenever I change the time intervals for ex: from ...
1
vote
1answer
44 views

Limiting woocommerce line_total decimal length

I am trying to get line_total woocommerce price, but i just cant figure out how to deal with number of decimals. It is now showing price with 4 decimals like 5.5444$ and i want it to show max 2 ...
0
votes
0answers
283 views

Insert data into mysql database with php and ajax

I made admin menu inside wordpress and I have form that allows admin to insert some values. I have html: <form id="prices_form" method="post" action=""> <div ...
0
votes
1answer
33 views

what is -> -> means in wordpress

I'm bit confusing what is the meaning of this line. $show_title = Ninja_Forms()->form( $form_id )->get_setting( 'show_title' ); "-> ->" available in PHP or it used only within wordpress.
0
votes
0answers
22 views

Save the value of a wp_dropdown_pages

I have created a wp_dropdown_pages based upon the WordPress codex page global $post; $args = array( 'date_format' => get_option('date_format'), 'depth' => 0, ...
0
votes
1answer
70 views

WP_Query count of different meta key values [duplicate]

I need to get count of different values of meta_key: Let's say I've got meta_key $class & there's only three different values: 1, 2 & 3. //My WP_Query $ads = new WP_Query(array( ...
0
votes
1answer
51 views

Invalid argument supplied for foreach() in search.php

I'm using this code on a search.php template to display search results, posts are formatted differently using a template part depending on the post term. This method works great on the index.php but ...
0
votes
1answer
50 views

Find all strings between an enclosing shortcode

I want to look for all strings in my theme located between my enclosing shortcode [question] desired string [/question]. Then I want to output the so collected strings somewhere in my theme , e.g. ...
0
votes
0answers
7 views

Post formats in 2 columns display

I'm having a hard time trying to figure out what's wrong in my loop. Here is my loop for a 2 columns post display : <?php $i = 0; ?> <?php if (have_posts()) : while (have_posts()) : ...
0
votes
1answer
29 views

How to change layout of shop page in wordpress? [closed]

Currently I am working on shop page. And according to the design I have to insert a banner after 4th product and after 7th product and I have 3 products in each row and Banner's size is equal to the ...
0
votes
1answer
46 views

Error in WP_update_post

i make php file outside from wordpress folder to edit wordpress post and i get error when i use this code. wp_update_post <?php include '/go1/wp-includes/post.php';?> <?php // Update post ...
0
votes
1answer
25 views

Search only working on front page (index) , not working on other pages

I'm currently building a custom WordPress template and I've run into a problem with the search box. When I use the searchbox from the homepage, it works as intended. It also works as long as ...
0
votes
1answer
28 views

Are WordPress widgets cached?

I'm not sure if it is true but seems that the content of the widgets is cached. I initially thought there was a problem with my code (I need to hide/show a section in a custom widget according to a ...
0
votes
2answers
42 views

Widget edit and add in any page

So I have this site and on the bottom of the site you can see the map and search. I have 2 problems with that: The search if offset not in line with the other elements. I want/need it to be full ...
0
votes
0answers
39 views

Remove Special Characters from Wordpress Media File Names in HTML

I've removed all the special characters from media filenames in the database (meta_key - _wp_attached_file - filename), I've renamed the files in the FTP and rebuilt the thumbnails a few times. ...
0
votes
5answers
52 views

How to redirect all 404 in a Wordpress subdirectory to the index.php of subdirectory?

I have a folder with name: wordpress_install/dev/abc Now, I have created a index.php in abc folder and I want all the urls like: wordpress_install/dev/abc/asdfasdfsdf (a 404 page) to be ...
0
votes
1answer
65 views

How to add together (get the sum) a field from all author's posts

Using the plugin WPeddit I want to count the epicredvote score from all posts of an author together to get the sum. The following is a custom field that puts out a score, like "3" or "-2" or ...
0
votes
1answer
108 views

Live search from database table

I have wordpress site. I made custom table and sotred values in one row. Now I made admin menu and added input field into it. <input id="location1" type="text" /> I need to predict search ...
0
votes
1answer
44 views

Add data-id attribute to child page links

The should be simple but I just can't figure it out nor find an answer. I need to add a data-id attribute to the <li> parent container of the respective child page <a> links. The HTML is ...
0
votes
1answer
40 views

Splitting the_content() by size?

I have a situation where users don't want to format quotes in post body and want to just paste their content, assign a quote in a custom field, and the template will now render the quote when viewing ...
0
votes
2answers
17 views

Adding wrapper elements in the_date() like in the_title()?

So this works: the_title( '<h1 class="entry-title">', '</h1>' ); But this does not: the_date( '<h4 class="entry-date">', '</h4>' ); I don't know enough if this is ...
2
votes
3answers
82 views

Get only the grandchildren, not the direct children of page/current page?

I know javascript pretty well now but I am new to php and wordpress theme building. I have searched a fair bit and can't find a solution to something that seems like a pretty simple task, all I would ...
0
votes
2answers
104 views

Get post id within comments loop

I have a custom comments loop on my author.php page. I am trying to get the post id so that I can echo the permalink for the post that the comment belongs to. Also so I can echo some post meta custom ...
0
votes
1answer
19 views

widget: input the px value from user and use it as inline style in widget function

I am trying to dynamically add margin-bottom property to my widget. For example, I am inputting the value "50px" from my widget and want to use this value to adjust margin-bottom property for the ...
0
votes
0answers
39 views

site-title to logo image

So question is following i am working on this website and i need to put a logo which i uploaded inside the header where the title is as text ..problem is ..i tried fiddling with header.php and ...
0
votes
1answer
17 views

<a> with PHP within splits the link

I've finally found out how to call a the project-type in a link so the link changes depending on which page it shows. This is the code: <h3 class="widget-title"> <a href="../">Terug ...
1
vote
1answer
162 views

How will php 7 affect Wordpress?

Will the new php 7 version be backwards compatible or will we face compatibility issues? Will it greatly affect the way we code for WordPress? My host offers php 7, should I use it for a WordPress ...