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

learn more… | top users | synonyms (1)

0
votes
1answer
32 views

Conditional featured image with youtube thumbnail

Basically what I am trying to do here is: Display the youtube thumbnail. If no youtube thumbnail -> Display the Featured image for the post. If no featured image -> Display the fallback image. ...
0
votes
0answers
6 views

post_row_actions to print pdf

I'm a bit of a newbie wordpress dev so apologies if this seems like a bit of a stupid question to ask. I'm trying to add a plugin which will allow me to print posts as custom styled pdfs. I've added ...
0
votes
1answer
21 views

Need to adjust condition to say if I'm pulling categories from a post, to pull only the first one

I have a condition to pull posts based on category so when in my single.php users can see related posts based on categories, but the problem here is if someone posts a post with more than one category,...
-2
votes
1answer
30 views

How to find out the URL of enabled theme(s)?

I've done some research, but can't find a solution. I want the URL or my themes. For example: example.com/atheme example.com/btheme example.com/ctheme This is to make a drop down so anonymous ...
0
votes
1answer
60 views

Merging two excerpt functions to work with conditions

I have two functions that affect the_excerpt: // Grab First Paragraph Of Text And Ignore Images For Excerpt function awesome_excerpt($text, $raw_excerpt) { if( ! $raw_excerpt ) { ...
0
votes
1answer
18 views

Using Conditionals when homepage is a page and blog is /blog

I am setting up a blog with a static front page (name: Front Page, slug: front-page) and the blog on a page named "Blog" with the slug "blog". What I want to do is have my site title be inside and h1 ...
0
votes
1answer
21 views

Get dimensions of logo

I have the following code installed in my header.php: <h1><img src="<?php echo esc_url( get_theme_mod( 'mitch_logo' ) ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display'...
0
votes
0answers
34 views

Advanced search query select from custom table

Hope that anyone can help me with this problem. I have 7 columns in my tbl2014wines custom Wordpress table. I am trying to create an advanced search feature that allows users to search by wine_name, ...
1
vote
1answer
40 views

Use Timber/Twig to pull an image by image ID [closed]

Is it possible to use Twig to pull an image by ID, or only to pull the post.thumbnail? The Twig docs don't seem to cover any other image need and I'd like to specify a backup image in case no post....
0
votes
1answer
14 views

Showing featured image of page's child's children page

so i have a page that has children pages acting as categories, that each have children pages themselves (parent > children > children of children). How would I go about showing the featured images of ...
0
votes
1answer
29 views

get the custom post type title/name

I'm using a custom post type and use this plugin to display my custom post type's archives, does anyone knows how to display my custom post type's name/title to the archive.php? Below is the archive....
-3
votes
1answer
26 views

File based on User Source

I would like to show my static html page to the users who come from Facebook and the default WordPress Page for other users. Anyone please let me know how can I do this?
0
votes
1answer
33 views

Link users to a custom post type

I would like to link a user to a custom post type (college). Does anyone know a good way to do this? The ultimate goal is to display links to view and edit their college I've been using Advanced ...
-1
votes
1answer
34 views

Place max_execution_time in plugin [closed]

I have a client who has a php script execution timeout problem on a locally installed wordpress. I dont have an access to machine to do the test, so here is my question. There is a custom plugin on ...
0
votes
0answers
20 views

Filter with 'OR' relationship between child categories, and 'AND' relationship between parent categories?

I have a some categories set up like so: Age Child Teen Adult Language English Spanish French Relevant code below: $cat = (isset($_GET['cat'])) ? $_GET['cat'] : 0; $args = array( ...
5
votes
1answer
32 views

Customizing subject in comment notification e-mails

How do you customize the following code in functions.php in order to have "New comment" as subject in comment notification e-mails instead of the default WordPress subject? function ...
0
votes
0answers
21 views

How to update Update click count in user meta

I have a custom code which updates count when someone click on each user link. Here is the code HTML OUTPUT <div class="grid-item grid-item--width2 user-img-32" rel="32"> <a href="https:...
2
votes
1answer
62 views

How to resolve error “Cookies are blocked due to unexpected output.”?

I am facing an error as per below at admin panel login. "ERROR: Cookies are blocked due to unexpected output." I've tried several solutions like, Log checking (No logs are showing in log file) ...
0
votes
0answers
14 views

User defined password in new user approve plugin

I am using new user approve plugin and I'm satisfied. It works, for web site and Rest API, but the problem is when I want to use my own password style (only numeric and 10 digits). I added some ...
4
votes
1answer
60 views

Check if user already visited this post today

I have a piece of code which measures a post popularity. How would I go about checking if user didn't already visited this post for past 24 hours? Do I need to set a cookie for user and for each post ...
0
votes
0answers
27 views

Need help running php on page

I need help running my PHP code on a WordPress page. I’m using a plugin to run my PHP code. This is a code I'm trying to run: <?php define('STEAM_CONDENSER_PATH', dirname(__FILE__) . '/wp-content/...
2
votes
1answer
33 views

Remove username in emails or swap username for email

Is there anyway I can remove all instances of the username in all WP emails, or swap our the username for the email address? I have some code in my functions.php file that removes the username from ...
1
vote
1answer
37 views

Trying to establish connection to External Database

I'm trying to get a connection to a separate external database from the database the wordpress site depends on. I have a PHP file inside the same location of my theme, it is basically a blank PHP it ...
0
votes
1answer
46 views

How to change thumbnail src attribute?

I am working on a plugin that can generate a thumbnail from a URL, getting the first image from posts; it is similar to an auto thumbnail generator. I get all img tags, but the URL is changed. Here is ...
1
vote
1answer
38 views

How to show phpinfo() only in a new tab?

My problem is that I want to add a link to my plugin which should direct the admin user to a new blank page which shows phpinfo()? Can anyone direct me how to do this? I know WordFence has a feature ...
0
votes
0answers
23 views

Determine if a page has been saved yet and has an ID using PHP?

I have a metabox on the edit screen which will check a custom database table for existance of a record matching the current pages ID. If the record exist then I show all my data. If the record does ...
0
votes
1answer
32 views

Add custom field to attachments in a specific category

I have a working function that adds a meta field to all attachments (so I can enter the url of a video). I would like this field to populate only on attachments in the "video" category. I've tried ...
2
votes
0answers
12 views

wp_handle_upload_prefilter valid date from input file

I want to ask some help, i'm having problem with thewp_handle_upload_prefilter Here is the code: add_filter('wp_handle_upload_prefilter','mdu_validate_image_size'); function mdu_validate_image_size( $...
4
votes
2answers
117 views

Load custom posts with same tag as page

I'm using this plugin to add tags for a page: http://wordpress.org/extend/plugins/post-tags-and-categories-for-pages/ And I've added tags support for the custom post: function codex_custom_init() { ...
0
votes
0answers
32 views

Issue with AJAX passing values from jQuery to PHP

I made an AJAX form in WordPress by making a plugin. The script runs well: First I retrieve the value from the form, then I send it into post_meta table, and finally I put the value in the div I want ...
0
votes
0answers
22 views

Wordpress using get_term to retreive slug not working as expected

Im using the below code to try and get the slug for the current category and the parent category. Ive managed to get as far as getting the currently cat slug but the parent displays in readable text ...
0
votes
1answer
33 views

1+1 php counter inside the update_post_meta

how do you create a 1+1 php counter inside the update_post_meta? this is the code i have so far: $count = 1; update_post_meta($bid_id, 'draftnumber', $count++); but the counter is not moving, so i ...
3
votes
2answers
50 views

How do I output a database option that is an array into a get_posts array?

This must be fairly simple, but I'm puzzled. And I may be going about it backwards. How do I output a database option that is an array into a get_posts array? I have an option in the database that ...
1
vote
1answer
29 views

Help with a $wpdb MySQL Query

I'm wanting to expand on the following query to look at multiple meta_key and meta_value values that have been created with the Advanced Custom Fields (ACF) plugin. e.g. meta_key 'colours_%_colour' ...
1
vote
1answer
19 views

Different post styles depending on category

I am using Zephyr theme The link to the blog page. I want to style each post differently based on the post category ex: social media, announcements ect. I would like to style them using a cards ...
1
vote
1answer
16 views

How to show 50×50 image thumbnail in Related Post

I am showing related post in my WordPress without any plugin, the issue is I want to show custom size of image in related post via CSS, how to do this? Here is my related post code . <?php ...
0
votes
0answers
20 views

clicking the next pagination, the last post was also in page 2 error

I need some help or explanation regarding pagination in custom post type, I'm using a theme, so there is a pagination readyset there is one problem, if i set the custom post type post per page into 2 ...
1
vote
1answer
36 views

How create a Shortcode with hover and complex options

I am wondering how do you do when you have to create a shortcode with multiple hover or complex options ( gradient, boxshadow etc, thing that can't be inline ). How do you generate the css. I don't ...
0
votes
1answer
24 views

show desktop version of website if button is submited

Hello i can't solve my problem. When users is on mobile device and click on "show mobile version" or something like that it will show him desktop version of web and if he click again switch back it ...
0
votes
0answers
34 views

How to set featured image from external url without downloading image [duplicate]

I want to set featured image of my post from external url and without downloading, I am using auto-post-thumbnail to generate featured image, but it save image to my server. Is there any method to do ...
0
votes
1answer
49 views

Problem with AJAX in wordpress plugin

I'm writing a plugin and trying to get some data from the database and post it using AJAX. After sending the AJAX request, PHP processes the data and is trying to give me some page data, but it doesn'...
0
votes
0answers
25 views

How to hide a post until its prerequisites are complete

I have two custom post types Exercises and Tempo Submissions. For each exercise, I have a field that contains an array of other exercises that are it's prerequisites. I also have an exercise field ...
0
votes
1answer
23 views

Rewrite /keyword1+keyword2.html to search page | .htaccess

I am facing trouble redirecting the keywords to search page in a wordpress 4.4 setup. What I am trying achieve is to rewrite/redirect www.site.com/**search+keyword.html*** to www.site.com/**?s=...
2
votes
3answers
141 views

How can I limit the length of the previous/next posts in my Wordpress Theme?

I am using the following code to show next/previous posts in my wordpress theme. <?php previous_post_link('<span class="left">&larr; %link</span>'); next_post_link('<span class="...
0
votes
3answers
85 views

Add URL parameter to all internal links using a specific theme

I got stuck with some modifications and maybe someone could give me some help. What am I doing I use the multiple theme plugin to switch themes for my WordPress project. To switch between the ...
-5
votes
1answer
47 views

is it possible to create cart functionality without woocommerce? [closed]

I was wondering about how I can create custom cart functionality without installing WooCommerce plugin. Is it possible?
1
vote
2answers
33 views

How to insert a local image with custom size

I am not very familiar with PHP yet but I am trying to build a Wordpress theme. In one of my theme files I simply want to insert an image (located at the theme directory /img/image.jpg) with a link ...
0
votes
0answers
44 views

Including wordpress core in php script impact on load speed

I'm using require('wp-load.php'); to be able to use wordpress's functions outside of wordpress. My question is, how much impact does this have on performance? Will it like double the load or ...
0
votes
1answer
42 views

$wpdb->delete column values IN ARRAY()?

I am wondering if this is possible? $wpdb->delete( 'table_name', array('id' => array(1, 2, 3)), array('%d') ); So, in this situation, it should remove 3 rows at once, and call the ...
2
votes
0answers
40 views

Dynamically add styles to WP TinyMCE editor

I want to add custom styles to Wordpress using dynamic arrays. My question is how can I add the two arrays to the style_formats array within the 'my_mce_before_init_insert_formats' function ...