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

learn more… | top users | synonyms (1)

2
votes
1answer
119 views

Wrong links in Wordpress?

I have a project on Wordpress. I would like add an article. In admin panel I click on Post, then Categories and add a new category called article. Next I add a new post and edit title, body and ...
0
votes
1answer
38 views

Or operators in PHP [closed]

can anyone advise what i'm doing wrong here? I'm trying to load a jQuery function IF the page isn't using a template OR if it's not a single OR if it's not an archive. I have the below... <?php ...
1
vote
1answer
1k 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 ...
0
votes
2answers
436 views

Get unique post in parent category

I have a parent category and several child categories. I also have several posts that belong to the child categories. Each post can be belong to several categories. I want to know how to query the ...
0
votes
1answer
174 views

How to use array in function to get only value I want

I am trying to work this function in wordpress theme the way where I can get value only what I want and not all to gather. I am not much familiar with using array in function so I need you expert help ...
-1
votes
1answer
334 views

how to search through plugin in wordpress cimy-user-extra-fields?

I have a plugin clalled - Cimy User Extra Fields. I need to search the content through this plugin. This plugin is in WordPress, and all the content are stored in the database also, like industry, ...
0
votes
1answer
127 views

How to remove parent section in an attachment URL in wordpress?

In wordpress, an unattached attachment URL is http://domain.com/?attachment=$id Once after it's attached to a parent, it goes with parent's URL structure, for example: ...
0
votes
2answers
149 views

How can I open up my administrative panel to everyone?

I'm planning on running a open news site that I want everyone to be able to view the inside of the site without registration. I feel like it should exist a simple check for viewing the WordPress ...
2
votes
2answers
2k views

How to register images uploaded via FTP in media library?

I'm using my own upload.php file to upload images to: $upload_dir = wp_upload_dir(); $targetDir = $upload_dir['path'].'/'; It works like it should with this exception that images uploaded to ...
0
votes
1answer
131 views

Post type Echo code is repeating on homepage

Hi i'm using this php code that allows me to call a div in different post type, but the only problem is when i add a second line instead of it showing only on the post type page it shows on the home ...
0
votes
2answers
290 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
1answer
1k 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. { ...
9
votes
2answers
8k 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
801 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 ...
1
vote
1answer
184 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
125 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
695 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, ...
2
votes
1answer
824 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
567 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
3k 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
513 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
683 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
1k 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
502 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'], ...
4
votes
2answers
3k 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
367 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
744 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
29 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
688 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 ...
3
votes
3answers
4k 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
806 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
253 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
187 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
986 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
883 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
167 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
103 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
117 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
167 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: ...
0
votes
1answer
247 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
361 views

Get category id when SEO URL is turned on

<?php /* Plugin Name: Members */ function myFilter2($query) { if ($query->is_category) { $currently_listing_categories = ...
0
votes
1answer
465 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
275 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
166 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
522 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 ...
7
votes
1answer
6k 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 ...
0
votes
2answers
57 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 ...