Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
0answers
10 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
53 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
48 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 + ...
0
votes
1answer
53 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
29 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
51 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
22 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 ...
1
vote
0answers
110 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
31 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
40 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
27 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
28 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
17 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
25 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
50 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
33 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
25 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
17 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
21 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
24 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
33 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
10 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
35 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' ); }
0
votes
1answer
22 views

Creating a Category Taxonomy

I have this entertainment site for TV shows. I cover at least 27 shows so far. I use so many different post types for the shows and it slows down the site, I eventually want to add more shows. I ...
0
votes
0answers
27 views

Editing a user info gives me error : Invalid User Id

As the topic says , when i try to edit a user's field ( name , email etc ) and click update it gives me an error saying invalid user id. I have no idea what i am looking for the fix it. If you ...
0
votes
0answers
28 views

Page 2+ of taxonomy archives does not recognise sort-order from dropdown

I'm using a custom taxonomy archive and I want the user to be able to organise it by 'latest' or 'alphabetical' along with other custom fields in a dropdown form. Seems to be working fine on the first ...
0
votes
0answers
19 views

Menus: Item appears twice in menu, current item classes fail – Bug?

I think I found a small bug in how Wordpress handles CSS classes applied to menu items. I would love to fix it, but so far I wasn't able to pinpoint the problem - it's probably in ...
0
votes
0answers
21 views

Copy image url to my own field in media upload

i have add new field in media upload for slider plugin. what i don't get it how to copy the image url to my own field. look at the screenshot:
0
votes
0answers
33 views

Custom menu walker: Repeating a menu item when it has children

I am trying to repeat a menu item when it has children. To better understand, maybe take a look at this example markup: <ul id="main-nav"> <li>Item 1</li> <li ...
1
vote
0answers
271 views

Woocommerce displaying product categories and products on custom theme

Am trying to create custom Woocommerce supporting theme in Wordpress. What am facing is regarding the displaying of Product Categories when accessing the main category and 1st level of categories. ...
0
votes
1answer
29 views

Not logged in when using http

I'm moving my WordPress multisite from one server to another, and have decided to use a WAMP (Uniserver Zero) for the new setup. I'm having one issue that doesn't occur on the old setup, only the new ...
0
votes
0answers
13 views

Where should i put my php script for ajax implementation in wordpress? [duplicate]

I want to implement ajax on a page . i create a folder under plugins and put php page there and it works(when i gave the correct path in jquery). But when i try to call any WordPress functions it ...
0
votes
0answers
18 views

If Specified Page then Redirect Elsewhere in Plugin

There's a few parent pages that only exist for URL purposes, but the actual page themselves need to be redirected to the home page since they're blank. I'm trying to make a simple plugin that will ...
0
votes
1answer
21 views

How to delete all trashed item in one-go

Currently I'm using wp-optimize to remove all trashed posts, trashed comments, draft posts However, this plugin sometimes not working and more important, it does not delete any trashed items from ...
0
votes
0answers
10 views

Let the user duplicate chunk of meta boxes

I have a CPT 'Product', that can be rented or sold multiple times over. Each time a transaction takes place, the admin would like to update some of the information (such as sale date, condition etc). ...
0
votes
1answer
27 views

How to initialize something in unit test before the init hook being called?

I've a simple PHP Unit written for WordPress and want the initialize code before the main 'init' action being called from the plugin I want to test, e.g. class MyPlugin_Test_Example extends ...
0
votes
2answers
44 views

Calling an custom field from theme option at the frontend

I am having trouble calling a field and displaying its content at the frontend from a custom theme option page. This is the code I am using to display my custom theme option at the backend ...
1
vote
1answer
40 views

I think emoji are killing my WordPress site… How can I debug?

I have had a rather frustrating last couple of days… after quite a bit of trial and error, I have come to the suspicion that emoji are killing my WordPress installation. Specifically, emoji in the ...
0
votes
1answer
20 views

Function not pulling image or text from custom post type

//Custom Post Type register_post_type('inf_main_feature', array( 'labels' => array( 'name' => 'Main Featured', 'singular_name' => 'Main Featured', ...
0
votes
0answers
41 views

Add different classes and use different image size on every nth post in loop

I'm creating a new site for a client and they want to have a Masonry style layout for the homepage with 3 different image & width sizes. The default class is "medium-3 small-square" but what I ...
0
votes
2answers
106 views

How to display posts of specific category using a custom Query in WordPress?

Hi I want to display a specific category from a custom query in WordPress. My code works fine and it gets the latest 4 posts, but what I want now is to retrieve a specific category. My code is below ...
0
votes
2answers
53 views

Display title list of all post of current post type

I have a custom post type called press. I'm on the template single-press.php What I want to achieve is generate a list of the titles (with it's corresponding link to it) of all press custom post ...
0
votes
1answer
101 views

Multiple do_shortcode in page template

Is it possible to nest multiple shortcodes with do_shortcode? Using visual composer and easytable with the visual editor, the classic editor displays: [vc_row][vc_column ...
1
vote
0answers
26 views

wordpress archive a user

Please note this question was originally created in stack overflow. I have moved it here due to recommendation. I apologize if this can be answered elsewhere. I tried searching around with no ...
2
votes
2answers
111 views

WP_User_Query order by meta_key that is an array

I have set a user metadata named achievements which is an array containing various numeric values. Using WP_User_Query, I want to order the list by a specific key within this array named points. The ...
1
vote
2answers
36 views

How Can I Call Up The Author's Name on a Post

For some reason my by author disappeared and I cant turn it back on. I know where I want to put it on single.php at the end of the post, but I can't figure out what code I have to put in for it to ...
0
votes
0answers
34 views

Show custom default avatar instead of gravatar

I'm using this custom function to get the default avatar from my server instead of gravatar: if(!function_exists('custom_avatar')){ function custom_avatar($avatar_defaults){ ...
0
votes
1answer
69 views

How To Make Connection To WordPress Data Base In A Plugin?

I am learning Plugins and I am trying to connect WordPress database wp-config.php in my Plugin PHP code. Currently for checking my code, I used the below connection and it is working fine. Now I ...
0
votes
1answer
28 views

If is page, archive or search output this code

Hi there I'm trying to make this code works for more than just home page but I'm getting errors while trying to accomplish it... can someone help me? I'm trying to use this: <?php if ...
0
votes
0answers
53 views

“imagejpeg” function is not working in wordpress

$image = imagecreatefromjpeg('http://localhost/test/wp-content/uploads/2014/09/city_81.jpg'); // choose a color for the ellipse $ellipseColor = imagecolorallocate($image, 0, 0, 255); // draw the ...