Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [php]

For questions about the server-side programming language that the WordPress core, plugins and themes are written in. Questions about using PHP outside a WordPress context are off-topic but might be asked on Stack Overflow.

0
votes
1answer
525 views

Plugin: Front-end Editor - User role specific editable content?

(using scribu's front-end-editor) Currently I have several custom fields and taxonomies that appear on posts as they are created by users. Each author is able to edit only their own posts. However, ...
3
votes
4answers
14k views

How to validate WordPress generated password in DB using PHP?

I am working with site that is done with WordPress, and I need to add some parts that are outside WP, and to check user login, Logging users outside WP. I tried with md5 of password but it's not... ...
7
votes
3answers
37k views

How WordPress encrypt password? [duplicate]

Possible Duplicate: How to validate WordPress generated password in DB using PHP? I am working with site that is done with WordPress, and I need to add some parts that are outside WP, and to ...
1
vote
2answers
4k views

Working with query_posts ( arrays and query strings)

I'm trying to use the search query along with an array of arguments to narrow down search results, but I'm failing horribly. This is what I have so far. $paged = (get_query_var('paged')) ? ...
-1
votes
1answer
2k views

WordPress plugin/code to to to next/previous post in same category

I have spent days looking for a WordPress plugin to automatically add next and previous links to the bottom of each post. I have found loads of plugins but I want one that will restrict the posts ...
1
vote
3answers
324 views

query in category.php repeats itself

I'm need some help on my query. I'm building up a category page where on top a post need to show where custom field key 'uitleg' has value 'ja'. Per category there is only one post with that value. ...
6
votes
4answers
880 views

How do you code for WordPress?

In plain php and frameworks coding is done with the help of IDE tools, im using PhpStorm and very happy so far, recently i decided to discover most popular CMS this days and got confused how do you ...
0
votes
3answers
2k views

How to get the second slug of a page url?

I have posts with a custom field called year. The year ranges from 1900 to 2011. I want to create an individual page for each year which will displays the posts with that year. So I will be creating a ...
0
votes
2answers
329 views

Dynamically append custom post type to end of url

At the moment my nav menu's category list only links to normal post_type archives. I'd like to dynamically append a custom post type, specifically ?post_type=portfolio, to the end of each url that ...
0
votes
1answer
3k views

how to edit wp category widget

how to edit wp category widget, so it would not show one of specified category? For example, it shows all categories in list, and I need to remove category Books, from it, how can I do it? Best ...
-1
votes
1answer
4k views

how to get category name if my category got custom slug

so my category got slug 'aeroplanes' and I need to get category names from it, but I can't get it with $category = get_the_category($post->ID); echo $category[0]->cat_name; cause it takes ...
-1
votes
1answer
173 views

Implement “No related posts for this entry” into the loop?

For my related posts I have set up a scrollable container. I need the HTML to be outside of the loop or otherwise the layout will be a mess if there are no related posts to display (missing divs that ...
2
votes
2answers
228 views

WordPress 2.8.5 & 'Responsive Twenty Ten' - error

So, According to the WordPress theme download page; the theme 'Twenty Ten' and it's child theme/plugin 'Responsive Twenty Ten' are compatible with 2.8+ I'm stuck with using 2.8.5 at work, I don't ...
0
votes
2answers
287 views

Modify pages widget and make a plugin?

I would like to make a plug-in that adds a widget. I would like it to be based on the current pages widget but add the ability to select either include OR exclude by drop down or checkbox then list ...
-1
votes
2answers
465 views

Im using a right approach to use this class inside WordPress theme?

I'm using a class to retrieve values from custom tables that I need to use in different files of my WordPress Theme and im not sure which is the best approach for this. This is the class i got right ...
1
vote
2answers
481 views

Can you run Wordpress on a MarketLive/Java EE server?

I am using MarketLive. I want to install Wordpress into a subfolder, but the person I'm speaking with says they can't do it because my site is built in Java. I want to install wordpress on my domain ...
0
votes
1answer
455 views

“operation successful” message

i'm writing some custom wordpress pages, and i want that after an action where the user has addess an item to a list (after the user press the submit button and the page reloads showing the updated ...
0
votes
3answers
2k views

Custom Database Table and foreach

I have just created a custom database table and would now like to output every inserted row from it into a predefined format using a foreach statement. Some guidance in this matter would be great. ...
0
votes
1answer
327 views

Showing author box on post detail page

Being new to word-press as well php i am struck at a point. I am trying to display author information along with his picture in the post and have successfully able to fetch all the data from gravatar....
0
votes
1answer
516 views

display sticky post outside loop and exclude from loop

I have a "featured" area in header.php that displays the content of the latest sticky post: $last_sticky_post = get_post(end(get_option('sticky_posts'))); if(!empty($last_sticky_post)): ...
1
vote
2answers
121 views

How can I include PHP-Code to my post?

I would like to use PHP in some posts. These posts should look like normal posts, be in the archive and categories like normal posts an have tags. I don't need PHP in every post, but it would be ...
1
vote
1answer
235 views

Adding Custom Forms

I'm looking to create a page for a wedding site that will have a form. The idea is that it is an RSVP page where a visitor will input a unique string that was on the invitation that they received and ...
0
votes
1answer
500 views

Can you echo PHP code from a variable?

Ok this is a stupid question, and I'm not sure I even asked it right, but this is what I'm trying to do. My wordpress theme supports ad placements and I want to use a advertising manager plugin. I ...
2
votes
1answer
3k views

wp_enqueue_style with style.php and Wordpress functions

I use wp_enqueue_style to add my stylesheet, like this: <?php wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.php', false, '1.0', 'all' ); ?> It works fine BUT I need ...
3
votes
1answer
2k views

Wordpress custom taxonomy description for each post?

In a Wordpress blog, I'd like to put the term description of a specific custom taxonomy in the footer of each article. Is this possible? I've tried <?php term_description( $term_id, $taxonomy ) ?...
0
votes
1answer
62 views

WordPress: Create A Widget to Accompany Plugin

So I have a plugin that I've created for the admin are when creating post... and I'd like to supply a widget along with it. I'm trying to figure out the best way to initialize my widget. I'm ...
5
votes
1answer
3k views

Is there a way to parse shortcodes in PHP?

Many plugins don't provide a documented way to access their functions from within PHP (e.g. when building a custom theme), but only shortcodes to insert in posts. Is there a standard way of executing ...
1
vote
1answer
13k views

Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin

I'm trying to write to an XML file in a WordPress Plugin. I'm on my local machine, a Mac running MAMP. I have PHP 5.2.13 My code is: $file_handle = fopen('markers.xml', 'w'); $stringdata = "Test ...
0
votes
1answer
300 views

Use Wordpress Text Editor in non-wp page

I have a page that is completely custom and does not fall into the Wordpress structure. However it is using data from the WP database. To access this I've used: define('WP_USE_THEMES', false); ...
0
votes
2answers
219 views

Warning: Cannot modify header information (with a twist)

Warning: Cannot modify header information - headers already sent by (output started at /home/ezekiel/public_html/boxsponsive/wp- content/themes/BoxSponsive-Portfolio/class.wp-less-styles.php:3) in /...
0
votes
1answer
660 views

Can 'Custom Field' data be inserted into this Short Code?

I have created a custom page template. In the template, I use a shortcode for JJ NextGen JQuery Slider. I would like the page to have a 'custom field' called 'Image Gallery' with a value that derives ...
2
votes
2answers
3k views

WordPress Custom Page Template in a different directory

Is it possible to have a custom page template in a different folder? I'm setting up a little framework for WordPress that I can use over and over for themes and just for the sake of being tidy I want ...
0
votes
1answer
1k views

Creating a mobile site by adding a new class to the body tag from functions.php

Essentially is there a way to use a function in functions.php to turn the <body> tag into <body class="mobile">? I have code that recognizes mobile devices but right now it's set up to ...
0
votes
1answer
105 views

Automatically load Wordpress page on server every XX hours

I have a page in my Wordpress site that calculates post popularity and updates several meta fields on the posts and calls a few functions as well. This page is set to "Private" so that only myself and ...
2
votes
1answer
563 views

How to create Sub Sub domain Multi User blogs?

Hi to all I would like to create a big Wordpress network with this structure: sitename.com (Main website) cat1.sitename.com (sub website) cat11.cat1.sitename.com (sub-sub website) cat12.cat2....
0
votes
2answers
216 views

Disable category RSS Feeds on Wordpress blog with PHP

I have a Wordpress powered site and I would like to know how to disable all category based RSS feeds with PHP or even mod-rewrite if possible. Thanks
0
votes
1answer
598 views

How to use custom fields to replace top-level parent title with an image using wp_list_pages?

I'd like to integrate get_post_meta into the wp_list_pages mix so that any top-level parent list items get replaced with images ONLY when a key exists in the post's custom fields section. I can't do ...
0
votes
1answer
2k views

Wordpress plug-in for dynamic download link?

I am using Wordpress and I like to serve a page with a link to download. That link points to a new file EACH DAY. Is there a plugin that can do this? Store a list of filename per day Rotate each day ...
0
votes
1answer
477 views

Function to add DIV Class?

I'm building a WordPress options panel. In my options panel I added the following, this creates a Yes/No dropdown menu asking whether or not the user wants to display breacrumbs - I want to be able ...
0
votes
3answers
448 views

Using WP functions such as the_title() in an included php file

I'm including a php file in single.php, in the loop. Is it possible to use WP variables such as the_title(), the_date(), etc in the included php file?
2
votes
1answer
127 views

Wordpress and Custom PHP single SignOn

I have a Wordpress installation and some php pages (not related to Wordpress). I want to use the same login between Wordpress and My Php pages. When I login from my php, and go to wordpress, it ...
-1
votes
1answer
328 views

Alternative loop syntax error [closed]

I'm trying to minimize my code and have put together this little snippet, it doesn't seem to work however. What am I missing? query_posts( 'year=2011' ); if ( have_posts() ); while ( have_posts() ); ...
0
votes
2answers
3k 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 ...
0
votes
3answers
6k views

wordpress wp_enqueue_script() not working

I'm trying to add this social-network button: <a href="http://svejo.net/submit/?url=[your url]" data-url="[your url]" data-type="compact" id="svejo-button">Add in Svejo</a> ...
0
votes
1answer
251 views

Can not call .php files after switching to %postname%

This $('#content').load("submenu.php"); works just fine with default permalinks When I switch to %postname% it does not work any more But, I can still go though to mysite.com/submenu.php and it ...
1
vote
2answers
401 views

WP_cron won't trigger my action

I'm in a dead end with a schedualed task in a wordpress plugin for a multisite. Somehow the action I added don't get triggered. The task is getting schedualed and returns a timestamp when I run ...
-1
votes
1answer
181 views

wordpress featured image

I'm new to Wordpress and I'm trying to create a new theme for it. I've downloaded the latest version (3.2.1) and installed it successfuly. But when I install my wordpress theme (to start to add the ...
0
votes
2answers
252 views

GET problem in WordPress

I have a strange problem. Any form using GET redirects back to the page not sending the variables. POST does work. I thought it might be an issue with the .htaccess but I deleted it and had WordPress ...
1
vote
1answer
2k views

How to sort posts based on the value (number) of a post's metadata?

I'm using the GD Star Rating plugin and the bbPress plugin. The first plugin do have a argument to sort posts by number of votes. But unfortunately, It doesn't work with WP_Query (and apparently the ...
0
votes
1answer
306 views

Add ASC / DESC to custom post columns

Im using the following code to create custom columns in the backend of the posts menu. add_filter('manage_edit-post_columns', 'post_edit_columns'); function post_edit_columns( $columns ) { ...