The server-side programming language that the WordPress core, plugins and themes are written in.
7
votes
1answer
657 views
How can I use WordPress functions in my stylesheet?
I have my style.php file looking like this.
<?php header('Content-Type: text/css');?>
#div{
background:<?php echo get_option('bgcolor');?>;
}
This does not work, but when I do ...
6
votes
4answers
13k views
WP insert post PHP function and Custom Fields
The wordpress function is used for submitting data programatically. Standard fields to submit to incude the content, excerpt, title, date and many more.
What there is no documentation for is how to ...
6
votes
2answers
7k views
How to manually fix the WordPress gallery code using PHP in functions.php?
It's been talked many times that Wordpress outputs some really bad code for the built-in gallery function.
This is the core code responsible for the gallery output (in /wp-includes/media.php):
...
7
votes
4answers
1k views
Inserting terms in an Hierarchical Taxonomy
I'm really having a few issues with inserting terms. Here is my scenario: I have a taxonomy called veda_release_type:
//Release Type and Region
$labels = array(
'name'=> ...
4
votes
5answers
7k views
How to split a loop into multiple columns
If I have a loop running from a category query like :
<?php $the_query = new WP_Query('cat=1&showposts=50&orderby=title&order=asc');?>
<ul>
<?php while ...
9
votes
3answers
4k views
User registration then auto login
I am using a plugin modified for my purposes. What I am after is after the user has registered for it to automatically log them in and return the to the current page. At the moment it sends them an ...
3
votes
4answers
728 views
the_date() not working
I am using wordpress 3.2 and I did a query post like this:
<?php query_posts("posts_per_page=1post=type&page=post_parent=10");?>
Then I try to echo out the date of this post I queried ...
2
votes
1answer
889 views
Proper use of Output Buffer
I'm attempting to use actions to override function calls I currently have throughout a template (to make updating certain replicated sections easier). For example, in archives.php I have the ...
4
votes
1answer
1k views
How can I fetch loop of post titles via AJAX?
I have a list of the most recent post titles in sidebar.php. Here is an example of how that code looks:
<?php $args = array('posts_per_page' => 20); ?>
<?php $sidebar = new ...
3
votes
3answers
1k views
Need help with friendly URL's in Wordpress
I'm creating som custom templates in Wordpress and I'm passing some data in the URL's.
Currently my URL looks like this:
http://www.mysite.com/designers/?id=43&name=designer+name
The URL ...
1
vote
2answers
2k views
class=“parent” for wp_list_pages?
<div class="menu">
<ul>
<?php wp_list_pages('exclude=&title_li='); ?>
</ul>
</div>
creates the following output...
<div class="menu">
...
0
votes
1answer
225 views
Stackoverflow type of badge plugin giving warnings in Wordpress 3.5
I modified an abandoned Stackoverflow form of badge plugin to work with Wordpress 3.4.2 and it does indeed. The full script for it is here: http://pastebin.com/Ta91zXiL
When upgrading to Wordpress ...
0
votes
1answer
357 views
How to Use the Function is_user_logged_in To Display Different Menus?
So, I want to create different menus for people who are logged in or not.
I got a reply that i should use a function
if (is_user_logged_in()) {
wp_name_menu(array('theme_location' => ...
8
votes
3answers
226 views
Make Google index the entire post if it is separated into several pages
While this is a question, it is as well a serious warning to publishers that separate their posts using <!--nextpage-->.
Bare with me. I run a highly trafficked multiple author platform that ...
4
votes
2answers
990 views
Does an activated plugin automatically mean its methods are available to other WP functions?
I made a WordPress plugin like this:
Class MY_CLASS {
//codes
}
Global $myclass;
$myclass = New MY_CLASS ();
After installed and activated the plugin, can I use this class in other plugins without ...
2
votes
2answers
109 views
How can I access the “description” of a menu item?
Where you can add your menu in under appearance > menus, I have descriptions in. In my page, I want to be able to echo out that description. Not in the menu, but in my page. How can I access this ...
0
votes
1answer
124 views
How to reduce the database query-es
Hy, i make a slide for news, the question is how can i reduce the dathabase queries...ore how can i compress this code...
http://s16.postimage.org/bswe0vrph/queries.jpg
<div id="featured" >
...
0
votes
3answers
102 views
How can i display 3 post types in same page?
How can i display 3 post types in same page search results.
http://cinema.trancelevel.com/
For example i have
post_type1-Movies
post_type2-Trailers
post_type3-Subtitrari
Wen i search i want to ...
0
votes
2answers
1k views
How to order posts by modified date without using 'query_posts'?
I have an example basic wordpress theme template here for you. First, please take a quick look at it to get an idea.
<?php
get_header(); ?>
<div id="primary">
<div ...
21
votes
6answers
2k views
Using OOP in themes
I see a lot of plugins making use of object-oriented coding when there isn't really necessary.
But what's even worse is that theme developers are starting to do the same thing. Commercial themes and ...
9
votes
8answers
3k views
Adding first / last CSS classes to menus
is that possible, without javascript hacks?
like this:
<ul class="my_menu">
<li class="first"> ... </li>
<li> ... </li>
<li> ... </li>
<li ...
5
votes
1answer
110 views
Allow Editors to edit pending posts but not draft ones
I have a large number of users with Editor Capabilities that help to go through the post submissions. This is my current setup for this role:
As you can see, they are allowed to edit_posts and ...
2
votes
2answers
964 views
WordPress upgrade now receiving Error 101 (net::ERR_CONNECTION_RESET): Unknown error
We have just updated to WordPress 3.1.3 by following the WP manual install tutorial. Note: This is a Network-enabled (multi-site) install. After uploading the new files, we now get the following error ...
1
vote
1answer
401 views
Enqueue Javascript Correctly for 3.5
I am trying to create tabs for admin settings page in wp, but I think I'm doing it wrong. The example below shows how I did it but I don't know how to change this to use it correctly with no conflict ...
2
votes
1answer
372 views
How to make simply “report” button on posts
I'm building up a video-site using wordpress. It embeds videos from different sites. I really need a simply "Report broken video"-button that saves the url in a database or emails it to me. I've ...
1
vote
1answer
308 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
...
1
vote
2answers
226 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
2k 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...
...
3
votes
1answer
53 views
Allow acces to wp-admin in wordpress
I am trying to restrict access to wp-admin: only administrators and editors should be able to access it. At the moment I am using this function:
function restrict_admin(){
//if not administrator, ...
2
votes
1answer
155 views
Site Title and Tagline in Theme Options Page
I'm using the Options Framework Theme to put together an options page. The user(s) I'm building this for would like to be able to edit a few settings directly from this page, including of which - the ...
2
votes
2answers
713 views
Getting $comments outside the comment template
I have a ajax request hooked on "template_redirect" (the ajax requests the post's url), and I want to display only the comment template:
function get_comm(){
if(isset($_GET['get_my_comments'])):
...
1
vote
1answer
151 views
Change comments form title on a page by page basis
I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to").
I thought perhaps I could add a hook to comment_form_defaults but my snippet below ...
0
votes
1answer
47 views
Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
I have been beating my brains on this one for days now and my Google-fu is failing me.
I have created a custom meta box with a dropdown menu that lists all of the terms from a custom taxonomy. What I ...
0
votes
0answers
67 views
How to build a search filter?
Can annybody tell me how can i build a search filter.. were do i start.
I want to filter the categories for 3 post type's
Ex:
I have Movies(posts) with categories
Year: 2011,2012,2013
Gene: ...
0
votes
1answer
190 views
Add Adsense code in index.php
My wordpress blog homepage has thumbnail gallery.
I want add adsense image ad code to 5,10 place.
Below code from my index
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
...
0
votes
1answer
167 views
is_singular won't call my functions?
Hi i'm using this code to call for a different stylesheet for a single post type but the problem is, It won't call the stylesheet.
It's in header.php, i also tried placing it in single.php
<?php
...
0
votes
1answer
207 views
Understanding Post Formats/Custom Post types Etc
I don't understand what "Adding Post Type Support" is for when we have "Adding Theme Support"?
For different post-formats this is the way I was shown before. This is then how I did it for the project ...
0
votes
0answers
85 views
Facebook. Fetch user photos and post them to blog on the user side [closed]
So I'm looking for some plugin or solution to implement such function. Fetch facebook photos (using json I guess) and post them to the blog.
0
votes
2answers
52 views
How to get movies by date
Ola,
i am building a complex cinema site, and i want to get movies by date
Ex: The movies are aded trought post type,
I have a custom field name date.
How can i retrive the Movie that shoud play ...
0
votes
1answer
143 views
Adjust the order for returned posts
I have written a neat responsive slider for my Wordpress featured articles (feel free to use it):
<?php
$responsive = 'on' != get_option('henrik_responsive_layout') ? false : true;
...
0
votes
3answers
581 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
78 views
Getting a WordPress Debug Strategy
I have been reading up on debugging. I watched Chip Bennett's video on wordpress.tv and was inspired to take debugging seriously. What I have found in my reading up though has confused me a bit. I ...
0
votes
2answers
154 views
I want to remove the links from the term list returned by get_the_term_list
I want to keep this category title on my pages, but I don't want it to be a link.
<?php echo get_the_term_list( get_the_ID(), 'portfolio_cats', ' ', ' , ', ' '); ?>
Can anyone help?
Thanks
0
votes
2answers
483 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 ...
0
votes
2answers
844 views
Making a Killer wp_link_pages
I am trying to achieve a similar look to the image below, a working example can be found here: http://www.menshealth.com/celebrity-fitness/mark-wahlberg-fighter-workout
The needed code must do the ...
0
votes
2answers
160 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
...
-1
votes
1answer
156 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, ...
-1
votes
1answer
194 views
how to set category name for a post
how to set category name for post:
this is my code ,this is not working ,why?
$post_title = $vname;
$categ='category name';
$post_content = '[newpage link="'.$videos.'"]';
...
-2
votes
2answers
209 views
Is there any way of not using my_init_method in the following code (that creates a custom post type)?
Mike Schindel provided me this code long time ago:
<?php
/**
* Create the Blocks custom post type and the Sections custom taxonomy
*/
add_action('init', 'my_init_method');
if ...
4
votes
2answers
1k views
Preserve custom URL parameter on more pages
I created a custom URL parameter for sorting posts by their vote scores. I have a "most voted" link that sends a ?sort=most_voted URL paramater and using a query posts filter I display posts with most ...

