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

learn more… | top users | synonyms (1)

1
vote
1answer
163 views

Is Auto Post recognition a WordPress feature? How to turn it off?

I noticed that if you go to lostlettermen.com/aa, it redirects to a post. Is this a feature in WordPress that can be turned off, or is this done by some type of plugin or custom code?
1
vote
1answer
321 views

Match checkbox data with page title to show certain items

I want to show the projects that has had it's checkbox ticked as Branding, if it's on the Branding page (i.e the page title is Branding). To explain the code a bit: This line show's all the ...
0
votes
0answers
69 views

Comment/post ratio system for users

In a multi-author platform, to enhance interaction between authors, I want to add a ratio system that calculates the author's comment count (on others posts) and post count and displays a grade. ...
0
votes
2answers
115 views

Limit checklist by the current user

Bare with me as I explain this. I'm adding an Assistant Editor feature to my multiple author platform. In the box that appears in post-edit page, the Editors can tick which task that they have done ...
0
votes
1answer
242 views

Geocoding an Exploded Custom Field Array

So, I'm having a little problem with crossing signals in WordPress between Google Maps' API and an exploded custom field. I want to be able to geocode an address that's been exploded from a custom ...
0
votes
1answer
1k views

Run W3 Total Cache Flush Function with Crontab

Ok. I'm really stumped on this one. Basically, I need to call a function for the Wordpress plugin W3 Total Cache as part of a cron job in crontab. I'd like to automatically clear the entire page ...
0
votes
1answer
126 views

Update some database fields when post is saved

I have a class that will count the Lines of Code, Source Lines of Code, and the Code disk space used. I would like to save these values into the database so that these values can be calculated only ...
0
votes
2answers
1k views

Conditional Statement - check if post has an attachment image

I'm working on a conditional statement (in a loop) that looks for a featured image then grabs a default image if there is none, which I have figured out. But, I also wanted a way to pull the first ...
5
votes
1answer
1k views

How display widget by id

I fetched widget id this way: $the_sidebars = wp_get_sidebars_widgets(); print_r( $the_sidebars['sidebar-1'] ); It shows: Array ( [0] => recent-posts-2 [1] => recent-comments-2 [2] ...
4
votes
2answers
632 views

Build a content and excerpt grid loop with paging and options for # of posts

What I'd like to do: on index.php, a loop that shows a selectable number of full posts using the_content and then below that shows a selectable number (the number of posts can be hardcoded in the ...
2
votes
1answer
836 views

Wp favorite posts get user favorites in profile using buddypress

Im currently encountering a problem i display user wp favorites posts fine, but the issue is i wont display them, once users are logged out it says " no posts have been made" while each user has ...
2
votes
1answer
363 views

Hide custom image sizes from media library

I want to hide a few custom image sizes from the media uploader: The following code (posted here) works only for the default image sizes: function remove_image_sizes($sizes) { ...
2
votes
2answers
353 views

If in parent category

I have this structure Category > Subcategory > Post I´m trying to display some content if the user it´s on a specific category, or in it´s subcategory or post. I´m using this code but it only works ...
2
votes
1answer
1k views

Bulk Image upload and one image for each post?

I have around 3000 photos, want to upload on WordPress. Is there any way to bulk upload all the photos as one image for each post ?
2
votes
2answers
284 views

Create new category upon save based on post information

After finding a couple of leads on how to do this, I'm coming up blank. What I am trying to accomplish is to add the post to a new category based on camera name. If the category doesn't exist, then to ...
1
vote
1answer
58 views

Saving Plugin settings to the database

I'm not a complete novice with php or wordpress but am wanting to approach this problem the most efficient way so believe asking here will help. I've got a plugin that randomly generates a quote - ...
1
vote
0answers
408 views

How to get Woocommerce Variation ID?

I am trying to create some additional functionality on my Woocommerce backend where I add a custom field to the variations section of backend of Woocommerce. However I cannot for the life of me ...
1
vote
1answer
48 views

Change Width of Featured Image Thumbnail on Add/Edit Post Page

Does anyone know of a way to change the width of the featured image on the edit post/add post page? I want to make it 50px wide. I'm not talking about the front page of the website, but the back end ...
1
vote
2answers
323 views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
1
vote
1answer
93 views

Wordpress PHP plugin - Settings page error

Writing a PHP plugin for Wordpress. It was an external PHP script. But now I'm having a problem. When I click submit on the page it redirects saying there are no permissions to go to that page. Edit: ...
1
vote
1answer
82 views

Remove class that has been added by parent theme

My parent theme generates the following class in body: style-cupcake. I don't want that. The best way to get rid of this is by adding my own functions in a functions.php file in my child theme, right? ...
1
vote
2answers
2k views

Limit the_excerpt with max of x characters

What I'm trying to do: I want to display the_excerpt, but I have a maximum of x characters the_excerpt may use, but I don't want to display a couple of characters of a word, only whole words. Some ...
1
vote
1answer
866 views

How can i create a function to get youtube video time

Tom J Nowell posted this code to help me retrieve the YouTube video time. Functions // function to parse the code from the URL function parse_youtube_video_id_from_url( $video_url ) { ...
1
vote
1answer
81 views

How do I attach a php file to an arbitrary slug and still have access to the wp-core functions?

Based on an example found here and several others, I am trying to load a non wordpress page from a specific URL while having access to the wordpress core. I have the following code (which seems to ...
1
vote
1answer
237 views

Getting movie and serial on actor page

I'm building a cinema site, I came with a problem, let me explain: Movies- are stored in Post's Actors- are stored in Post Type - persoane ( taxonomy= lista) Serials - are stored in Post Type - ...
1
vote
1answer
616 views

Change slug with custom field

I want to change the slug of a post with a custom field. In example, if the custom field is "keyword" my post link will become: mysite.com/keyword. If the custom field is empty, i want to generate a ...
1
vote
1answer
335 views

Mass update excerpt

I'm using a photoblog theme which upon creating a new post it takes the post attachment and saves a modified "img src" string into the excerpt field. It then uses <?php the_excerpt(); ?> to ...
1
vote
2answers
919 views

external wordpress pages using wp-blog-header

I am setting up a few sections of a website external to the core wordpress installation, but I still want to use the built in wpdb functions, and/or header files from wordpress. I follow the ...
1
vote
2answers
291 views

How to Append to the_excerpt() Function

I have the following snippet of code: <?php>$more = '.....';?> <p class="extra"><?php the_excerpt(); ?></p> What I am trying to do is append the value of $more to ...
1
vote
1answer
476 views

Thumb rating for wordpress - top user

I am currently using gd star rating (thumb rating) to rate posts (articles - no rating on comments). What I really want to do is show a table of the top 5 users and their number of votes based on the ...
1
vote
2answers
425 views

Make Selected Mutiselect Items “selected”

I'm developing a theme settings panel for a new wordpress theme that have an option to exclude categories from being shown in the loop. I managed to get the main functionality to work, using a ...
1
vote
2answers
798 views

Initialize WordPress environment to use in a real cron script

I have to run a PHP script through real cron (WP cron being too unreliable). Within that script, I need $wpdb to insert data into WordPress table. But of course $wpdb will not be available as ...
1
vote
1answer
488 views

Wordpress shop: enable custormers to select product color using image thumbnails on Custom Fields

I use Wordpress Custom Fields to provide customers with various product color codes in a drop-down list, but now I would like to add the various color thumbnails for ease of selection...similar to how ...
1
vote
1answer
940 views

How do I create a drop down menu in a widget?

How do I create a simple dropdown menu with 3 options in a widget? I'm using $instance to do it. How would it look in a barebones widget?
1
vote
2answers
3k views

Show dialog box in TinyMCE plugin and use WordPress php functions in it

I'm adding a TinyMCE button to my plugin. So far, I've been able to add the button and call my editor_plugin.js file and it's command. Not an easy mission btw... I want this button to show a Dialog ...
1
vote
2answers
794 views

Extract the first oembed url inserted on the content of a post

I want to extract the first oEmbed url inserted on the content of a post in order to put in a meta tag from the header, or elsewhere as a way to style it differently from the rest of the content.
1
vote
1answer
224 views

On update to 3.04 site started recording accents as “&Atilde;&iexcl;” and “á”, what to do?

One day my site worked perfectly and the next it suddenly started to have trouble recording accented characters. The problem affects posts' body, if I submit a post with an accent on the title it ...
1
vote
2answers
2k views

How do I make wordpress comment fields required?

Here is my form: <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" class="validate"> <?php if($user_ID) : ?> <?php ...
1
vote
1answer
340 views

Why does this echo values in the wrong order?

I'm sure there is a simple reason/answer for this: Why does echo 'Archive for '. the_time('Y'); give me 2010Archive for? I had expected it would give me Archive for 2010
1
vote
1answer
187 views

Prevent WordPress from loading comments

I'm displaying the comments for a post my way, using $comm = get_comments() and then passing $comm to wp_list_comments() (this is the reason why). How to disable WordPress from loading comments from ...
0
votes
0answers
18 views

Separation of view and logic

I find that very easily my views become cluttered with logic, e.g. null checks, email validation, and retrieving values from the post object. How would you separate this out in Wordpress? Is there any ...
0
votes
0answers
29 views

How to validate datepickers before publish

I have two datepickers in my post: 1. start_date and 2.end_date Basically, I need to check if end_date is greater than start_date before I can proceed to publish. From a previous solution here, I ...
0
votes
2answers
53 views

Why isn't my if/elseif/else working correctly here?

I am using a simple if/elseif/else bit of code to generate a header image for my page, I can't seem to understand why it isn't working properly. It determines the category of the page being displayed ...
0
votes
2answers
127 views

Nice scroll to wordpress

I am converting html5 to wordpress Theme. I want to use custom scroll for wordpress. The code DEPENDENCIES It's a plugin for the jquery framework, you need to include jquery in your scripts. I will ...
0
votes
2answers
38 views

Wordpress theme & site not loading after moving files

I was recently created a custom application for wordpress. So while doing so in my file manager (I use the one provided by godaddy(my webhost)), I moved all the files from the [DOCUMENT_ROOT] ... the ...
0
votes
3answers
134 views

Custom Loop Pagination on WordPress

I'm trying to create a magazine style website. For this particular page (not homepage) I'd like to fetch the latest post and style it one way (style1). For all the other posts I'd like to just display ...
0
votes
2answers
80 views

How to allow PHP In WordPress text widget

I want to add a text widget to my new WordPress website, but in the text widget there are some PHP snippets and I am finding it difficult to do it. Please help me Guys.
0
votes
1answer
355 views

Loading wordpress stuff on laravel site

I not sure why i failed to load the wordpress site on the laravel site. the following code, i tested on plain php without any framework - it work! but if i call from the file within laravel framework ...
0
votes
1answer
33 views

date function not correctly returning date

This code is being used to generate the date of a post in wordpress: <span class="the_date">Posted: <?php echo get_the_time('F d, Y'); ?></span> However it is not resutning the ...
0
votes
1answer
85 views

Do I require the use of nonce?

Im creating a visit/page views counter with ajax,jquery and php, I have been reading a few articles that recommend the use of nonces for data manipulation through ajax, however i am not sure if i need ...