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

learn more… | top users | synonyms (1)

0
votes
2answers
484 views

Thumbnails appear to be zoomed

Im using a theme which has my thumbnais set to 150x150px. But after installing plugin (just too check it out) I noticed it displays them correctly, but the default thumbnails are zoomed in. Can ...
4
votes
2answers
2k views

Searching users with WP_List_Table plug-in

I am trying to devlope a plugin that will search and return my users so I can edit some other metatdata that belongs to them. I have been using the plug-in listed on the Codex as my starting point. I ...
2
votes
1answer
1k views

Fatal error: Call to undefined function wpsc_cart_item_count()

-- I've just done a fresh install of Wordpress 3.4 -- I've downloaded and uploaded this new free eCommerce wordpress theme suggested by smashing magazine. { http://www.smashingmagazine.com/2011/10/...
18
votes
5answers
18k views

Sending the reset password link programatically

I have this manually created page: $user_login = sanitize_text_field( $_GET['user_login'] ); if ( username_exists( $user_login ) || email_exists($user_login) ) { ?> <!--Everything has been ...
2
votes
1answer
1k views

Add a Custom Class to Admin Menus

I am looking for a way to add some custom classes to the admin menus using PHP. For example, here are the li tag for Posts and Pages: <li id="menu-posts" class="wp-has-submenu wp-has-current-...
1
vote
1answer
226 views

Sort by page information by Ascending Numbers

Basically I have a problem that I have details being pulled from advanced custom fields and I currently have them ordered by page title in ascending order. However, instead of ordering them Ascending ...
1
vote
1answer
131 views

Where to put snarfer.php?

I followed these instructions: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates My understanding of those instructions was that the file snarfer.php needed to be in the folder '...
0
votes
1answer
926 views

Apply class to every third list item? [duplicate]

Possible Duplicate: How to mark every 3rd post I'm trying to give a class to every third list item on my page. I know how to give a class to every item, but not to specific items in a row, or ...
2
votes
1answer
1k views

Use ajax to update_post_meta

2 days ago I asked this then I tried to work on my code to be able to understand how ajax and php work and now I have a new issue that, probably would be easily solved. These are my codes: <?php /...
2
votes
2answers
821 views

How to get all events from 'All in one Events calender' plugin in JSON format?

I am using All in one Events Calendar plugin to add the events. It works fine in CMS. I would like to display the events data in mobile version. for this i used JSON-API for obtaining web-services in ...
1
vote
1answer
5k views

get current category ID php

I'm trying to get category ID of the current archive displayed. I tried: // category (can be a parent category) $current_cat_ID = get_query_var('cat'); // print_r ($current_cat_ID); It doesn't ...
5
votes
1answer
622 views

Wordpress URL Rewrite not working

I'm trying to create a custom url rewrite for my wordpress plugin. function insert_plugin_rewrite_rule($rules) { global $wp, $wp_rewrite; $wp->add_query_var('update_slug'); $ret = $...
4
votes
3answers
987 views

Rename files on upload

I have been trying to rename my images on upload and only piece of code I found was the one that uses a 32char hash. function make_filename_hash($filename) { $info = pathinfo($filename); $ext ...
3
votes
2answers
1k views

How to insert PHP code in a WordPress Post

I need to insert into post a simple form handler, but WordPress' engine deleted my code after saving. how can I fix it?
0
votes
3answers
2k views

Display WordPress Post Content in 3 Columns

How can I display WordPress Post Content in 3 Columns and in order using WP_Query(); ? For example, <div class="1column"> Post-1 Post-4 </div> <div class="2column"> ...
0
votes
1answer
621 views

update_post_meta not working

Making a plugin to make my life easier at creating over 3000+ pages. Take a look at the code I have so far. if (isset($_POST['action'])) { $one = array( 'post_title' => $_POST['title'], '...
5
votes
2answers
5k views

How do I directly access a PHP file located in my themes folder?

I have a file in my theme's folder called "test.php". If I go to www.mysite.com/wp-content/themes/my-theme/folder/test.php the theme loads which I assume is a 404 error handled by WP. If I change the ...
0
votes
1answer
512 views

Validate emails in array using foreach

How do I validate an array of emails from a textbox before sending them to the wp_mail function? $emails = 'test@test.com;test2@test2.com email3@email3.com,email4@email4.com, email5.com'; $emails = ...
0
votes
2answers
885 views

Remove the <ul> Tag from wp_nav_menu

I want to remove the <ul> tags from the wp_nav_menu. I already found different posts about it here but they don´t seem to work for me. Here is what I did: First I registered the menu in ...
0
votes
1answer
30 views

wordpress taxonomy in regular posts

I have a custom post type and taxonomy so the user can post in a specific areas in the theme. User (admin) can add categories easily. But the categories that has been added through my taxonomy don't ...
1
vote
3answers
932 views

Loop with slider (slider not loading)

In my slider.php I have a loop that calls for a custom post type. That custom post type has a meta box for a slide url (link/title/etc). I can see the loop and everything else is working because in ...
4
votes
3answers
7k views

How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?

The current result is "PHP Fatal error: Call to undefined function wp_get_current_user()" which makes sense, but doesn't help. I need to use $current_user. Here is the code I'm currently using: $...
0
votes
1answer
974 views

PHP Widget and do_shortcode

I'm using PHP Widget which allows PHP code to execute from a widget. I tried using this code to execute do_shortcode but it's not rendering <?php $lat = get_field('woo_maps_lat'); $long = ...
1
vote
0answers
326 views

List authors with the last post title and order by last post date

I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them. // Selects from tables wp_users and wp_posts, selecting published ...
0
votes
1answer
245 views

Menu not styling. New menus functionality giving me a headache

I can't find a good tutorial on the new menu handling functions, and the ones I found don't seem to work for me. What am I doing wrong? In my functions.php: (I'm using the Blank Slate theme as a ...
1
vote
1answer
1k views

Using WP Category Lists Plugin to Dynamically Display Category (PHP)

I am trying to use the Category Posts (WP-CPL) plug-in on a blog I'm working on to filter 'Recent Posts' by category. Basically, when someone clicks on the category name on the blog, I would like it ...
0
votes
1answer
1k views

Pulling Advanced Custom Fields from other pages

Basically I am using Advanced Custom Fields and have an ajax tabbing system that works with the ACF. The current set up is below: <ul class="css-tabs"> <li><a class="current" ...
0
votes
3answers
208 views

Only show image from custom field when present

How would I adjust the following code to only show the image tag when there is a variable present in the "imageembed" field? <?php $imageid = get_post_meta($post->ID, 'imageembed', true); ?> ...
0
votes
1answer
116 views

Cinema site, retrive the movies that actor play in

Hy, im building a cinema site in wp... For movies - I am using POST - The movies are post there.. For actors - I am using post_type : persoane , Taxonomy : lista. Ex: In post i add the movie, with ...
1
vote
1answer
2k views

Drop down+sort blog posts date added/most popular

Is it possible to have a drop down menu like youtube/demonoid that allows you to sort your index (and caterogy.php) blog posts by date/popularity/viewed)? I seen plugins for adding most popular ...
1
vote
0answers
125 views

Automatic Shortcode Creation with Custom Fields

This is basically a php issue as I'm fairly new to it and can't figure out how to code things the way I want. I am basically trying to pull information from custom fields (grid reference) and post ...
0
votes
1answer
182 views

Getting a specific “title for a section” only on Startpage?

I have a website which shows alle posts from my wordpress on the startpage. thanks to Stephen Harris who helped me with this code I put in the functions.php: add_action('pre_get_posts','...
0
votes
1answer
271 views

Load Javascript from Plugin in One Page Only?

I use the ALO EasyMail Newsletter. But the plugin is loading lots of Javascript in the head. I have a mobile site and the scripts are loading in all the pages. I think this affects the mobile ...
0
votes
2answers
469 views

Get category id when SEO URL is turned on

<?php /* Plugin Name: Members */ function myFilter2($query) { if ($query->is_category) { $currently_listing_categories = $query->query_vars['category__in'...
0
votes
1answer
597 views

Get date function not working

I have a function to get the date. I have input fields and want the date in this fields. But my code is set a wrong date. I set the date in Wordpress settings and on my server. But it is not working. ...
0
votes
1answer
315 views

if is_home(), change class of menu-item-225 of wp_nav_menu

Thanks for taking the time to check this out. I know it's outdated, but I'm using Wordpress 3.2.1. I have a Custom Home Page - where I created a Page for it and titled it as my Home Page with the ...
1
vote
0answers
175 views

Passing the page ID to a login php script

I'm trying to create a simple registration process which goes like this, A visitor clicks on a link (which is viewable only after entering some information such as name, email, phone etc.) This ...
0
votes
1answer
645 views

Why use foreach to get attachment_id if numberposts is equal to 1?

I needed to pass an image to a Pinterest plugin in posts without a Featured Image so I wrote a little function to get the id of the first picture in a post. This code is in the loop-single.php where ...
8
votes
1answer
10k views

How does printf( __( ) ); work?

Today I work through a theme to get a better understanding of WordPress and templating. I discovered this: <?php printf( __('Designed by %s', 'Anyword'), '<a href="http://www.example....
0
votes
2answers
60 views

How to include custom code on a page that's set to act as homepage?

I have a page called 'home' which is set to be the front of my site, but I'd like it to show the most recent blog post or two at the bottom. I have some PHP that will do this from another site <?...
2
votes
1answer
4k views

Woocommerce Custom CSV export

I've been trying to figure this out for the past few days. Is there a plugin that exports CSV with the Order Items all on the same line but not in the same column cell? Example: Item Name_01, Item ...
0
votes
1answer
312 views

WordPress most commented posts of last X days

I'm working on implementing a WP feature that shows the most commented posts from the last X days (e.g. lat 2 days). I've used the following code I found on the web (and here on SO), which does the ...
2
votes
3answers
4k views

How to Add Custom Fields to Custom Taxonomies in Wordpress CLEANLY

Saving extra fields that were added to a taxonomy. I want the most proper & efficient way of doing so. Where should I save the new fields? 2 possible solutions are to 1) Use the Wordpress ...
0
votes
1answer
42 views

images in wordpress themes

I am developin a theme in php using wordpress.I want to display images on the website . so my question is what will be the best practise 1)store the image itself in a table using an "image" or "...
2
votes
2answers
10k views

Wordpress redirect to landing page if not logged in

I'm using the following code in my functions.php file to redirect users who are not logged in to a particular landing page <?php if(!is_user_logged_in()) { wp_redirect( 'http://www.mysite....
0
votes
1answer
101 views

Nav Menu Display

Hi I'm wanting to create a custom navigation menu that will require creating 2 div containers to hold the SUB-MENU set. In other words I want to do this: <div id="access"> <div class="...
5
votes
2answers
1k views

Can i use php sql functions instead of $wpdb?

I'm new to WordPress and was wondering why in WordPress API do they tell you to use functions such as prepare(), insert(), get_col(), get_row(), query(), etc. when technically I can use the built-in ...
0
votes
1answer
155 views

split searchresults into different topics?

How could I split the searchresults into topics. I have e.g. three Topics - cars | computers | culture all are "custom post types" . Now a user searches for term "speed" in the searchbox and the ...
2
votes
4answers
564 views

Filter link to existing content suggestion

How can i filter the link given in "link to existing content". Eg: As in the above image. I just want WSP BANNER TO BE SHOWN. where WSP BANNER & CALENDAR are custom POST types Any help will ...
1
vote
2answers
617 views

PHP Code stuck in Cache [Memcached] [closed]

Been having a bit of a problem with my site regarding our caching method and my php code not refreshing or flushing. To start, my site is on a dedicated Nginx webserver. I used W3 Total Cache for ...