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

learn more… | top users | synonyms (1)

-1
votes
4answers
981 views

Insert into db with foreach problem

I have no idea why this foreach it`s not running. When i post the article, only inserts once. Should make it at much as needed. Do you see any problem? $array_produse = array(); for($i=1; $i<=8; ...
0
votes
1answer
48 views

Trying to put a search page on site

i'm trying to put a search page on my site. I thought it would be simple, but I am having no success. I have put a form in my header.php (which I call in my search.php page (include "header.php")) ...
1
vote
1answer
56 views

Pull the content out of a page

I wanna pull the data from this area "see the red area on the image below" Out to a specific template I have a page template named page.php <div class="contentholder"> <?php ...
0
votes
1answer
557 views

How to have different header.php based on the user logged in?

I’ve a created wordpress membership site using wishlist member plugin. But I want to have different header.php based on different logins. Eg: Users are: Print, Web and Free When Free user logs in – ...
0
votes
2answers
716 views

I don't have comments.php… how do I customize my comment fields

My page in question is here. I have tried to add a comments.php to my custom theme so I can remove the website field and so I could edit the default values of the fields and remove the labels. When I ...
0
votes
1answer
117 views

Stop header code from showing in category page?

Hi I'm using the code below to show different header images in my custom template archives. Only problem is that it is also showing the headers in the category templates. go to ...
-1
votes
1answer
159 views

Use php array outside his function

any ideas why my function print_r $arr with lot of elements, but only retain cat and dog when it comes to print_r $stack? I need to have $arr used outside the function, function ...
0
votes
1answer
583 views

How do I use CSS or PHP to customize Wordpress Form Manager Plugin Table?

I'm using Wordpress Form Manager Plugin to design a table to display race winners for an athletic event. <table class="fm-data"> <tbody> <tr> <td ...
-2
votes
1answer
571 views

wordpress illegal string offset 'parameter' error

I am getting the error illegal string offset when creating a checkbox in the admin. my code look like this. <input type="checkbox" id="slideThre" name="custom_settings[checked]" value="1" ...
0
votes
1answer
92 views

Post Views Code Hacks

// Post views function getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ ...
0
votes
1answer
65 views

Custom Links in Walker Class

I am creating a custom walker class. I need to identify the custom links that will be added to the menu from Appearace > Menu > Custom Link so that they will have a different format to the page/post ...
0
votes
1answer
2k views

Displaying Overlay images over thumbnail of category type?

How would I place an overlay image over a thumbnail of a certain category. For example. I have the category "Videos" how would i place a playbutton image over the thumbnail, while making it all link ...
0
votes
1answer
103 views

WP_LINK_PAGES Generating Unnecessary </p> Tag

This is the current output for my WP_LINK_PAGES, notice the unnecessary </p> tag at the end. My code for my custom WP_LINK_PAGES can be found here. <div id="link_wrap"> <span ...
0
votes
1answer
43 views

Closing WP_LINK_PAGES DIV ID w/After Argmuent

In my code below I need to close the div "link_wrap" which I created with $args['before'] = '<div id="link_wrap">'; When I try to paste $args['after'] = '</div>'; above return $args; it ...
0
votes
2answers
714 views

Dropdown Menu for Query_Posts

I can successfully query post results using query posts like so... <?php // The Query query_posts("gdsr_sort=rating"); // The Loop while ( have_posts() ) : the_post(); ?> <?php ...
0
votes
2answers
132 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
43 views

Stuck with sidebar registering

I tried to add a custom page to my Wordpress template. That part is good. What I´m stuck with is a common sidebar that appears although I registered a custom sidebar for it. I am calling the ...
0
votes
1answer
200 views

Wordpress get_avatar function not correct working

My code doing this, listing which author have posted in the current category. But get_avatar function not correct working. Im Using Simple Local Avatar Plugin. It is working author.php don't have any ...
7
votes
2answers
2k views

What is the correct way to build a widget using OOP

I am working on a simple search form widget, with a built in autocomplete capability (You can download the current version here). The plugin is working, but I am currently rewriting all the code using ...
-2
votes
1answer
132 views

Pagination not working properly

I have a list of posts from a category as seen here in this example. The problem is, if you scroll down to the bottom and click older, you'll see that the posts on the page have not changed at all, ...
0
votes
2answers
452 views

Transform php code into a widget?

how can I create a widget out of a php code? It's just a disqus code that I would like to place in the sidebar. I could just paste the code in the widget section (my tag), but then I would not be ...
0
votes
1answer
1k views

Wordpress SQL JOIN query

Hi Im trying to run 2 querys in the same query call. // send the query global $wpdb; $commentQ = "SELECT * FROM $wpdb->comments " . $whereClause . $orderBy; $comments = ...
1
vote
1answer
384 views

If meta_value = 'yes', then add class?

meta_key=_jsFeaturedPost meta_value=yes I have posts where some have meta keys/values and some don't. I would like to target the ones with the meta keys that have a value of 'yes' and add a CSS ...
0
votes
2answers
2k views

How do I remove a category from a wordpress loop>

I have a question. I need to have, in my archive.php file, a exclusion of a specific category. given what I have now, how would I make that happen? Here is the code: <?php ...
0
votes
1answer
57 views

Is this plugin safe to run?

This is an extract of code from a wordpress plugin. Is it safe to run despite the variables not being filtered? Also does the wpdb class filter to prevent any injection? list($email_id, $user_id, ...
18
votes
5answers
930 views

Why have <?php and ?> on every line

I've seen this convention pretty much everywhere, and, at times, it comes close to driving me nuts: <?php //The loop ?> <?php while ( have_posts() ) : the_post(); ?> <?php ...
1
vote
2answers
304 views

What difference does it make including the @package annotation or not?

I am somewhat familiar with the concept of packages in Java, but I'm new to Wordpress and PHP. In a template file such as header.php, what is happening when you include the @package notation? ...
0
votes
2answers
81 views

WP Login Button for current domain

I want to make a link that goes to wp-login.php for whatever domain I'm at now. Something like: <a ...
0
votes
1answer
777 views

Aspx/Rss feed - failed to open stream: Redirection limit reached

I have this issue ive been stuck with now. Its when i load a page that have a feed. I put the feed in wp-admin , this usually work with other feeds but not sure why its not working with this kind of ...
2
votes
2answers
3k views

Knowing the total number of posts before to get into the loop

Is there a way to know the total number of posts before the loop starts? I'm thinking in use two loops. The first will do the counting, while the second one will handle the content. However, I don't ...
3
votes
2answers
6k views

Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]

I'm trying to feed checkbox values from a Gravity Forms form (which creates a new post) into an Advanced Custom Fields field. I've had a read around and found some info in a post (at the bottom of the ...
0
votes
1answer
41 views

Adding an Unlinked Space in a Custom Function

This question has been a pain in my side for the last few days. I am using a function to display page numbers and next/previous links with WP_LINK_PAGES. The code I'm using (below) is a shortened ...
0
votes
2answers
202 views

Strip hashtag off permalink with php

I use the_permalink() to pass the current page to the facebook like button. But when one goes directly to a comment link with a hashtag, such as example.com/post#comment1, it's considered a separate ...
6
votes
3answers
8k views

is it possible to run some php code within a wordpress page?

I'd like to access a DB table and render it in some data grid format using php on a dedicated wordpress page, accessible to members of a certain group. Is this at all possible with wordpress or is ...
0
votes
1answer
129 views

Which version of PHP-FPM is necessary to work with WP 3.5?

I'm trying to establish a blog with NGINX and PHP-FPM. I wonder if my version of PHP should work with WordPress /usr/bin/php-cgi -v PHP Warning: PHP Startup: magickwand: Unable to initialize ...
-2
votes
2answers
2k views

How do I remove blog entries from home page Twenty Eleven child theme?

I have been wrestling with this for some time. I've read the documentation about creating a separate home page and posts page, and so on, and I have managed to create a landing page, and a blog. ...
1
vote
1answer
166 views

Displaying custom field according to date

I am not sure whether this is an Advanced Custom Fields-related question, or a general PHP question, so I have also posted this to the ACF support forum, for those of you who are also looking for ...
1
vote
2answers
205 views

How to simultaneously access the same MySQL database in the main column and sidebar of Wordpress?

I've wrote some basic custom PHP code for my Wordpress site. The code basically access a MySQL database (a different database from the wordpress database) and displays the information. In addition to ...
2
votes
2answers
472 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
588 views

How can i count the post added in relationship field, theme display

How can i count the post added in relationship field. The relationship field is a plugin (http://www.advancedcustomfields.com/docs/field-types/relationship/) In my admin i have a MetaBox i create to ...
0
votes
2answers
126 views

exclude custom post type from running a function

I have the following code in my functions.php file to display post shortlink in my posts (I prefer not to edit theme files if possible)... function add_post_content($content) { if ( is_single() ) ...
0
votes
1answer
2k 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 ...
1
vote
1answer
377 views

How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)

I've created my own theme based on a very lean template. My theme is not parsing the [caption]...[/caption] markup to the correct html. It's just showing the text without any markup around it. Here ...
0
votes
3answers
376 views

Display a custom field rating system in the front end

I have added a content rating system to my platform where the authors can select which audience their post is appropriate for. Currently, these options are available: Unrated G PG ...
0
votes
1answer
259 views

Hide content from Post Preview

Is it possible to hide content in Post Preview (that is not hidden when the post is published)? I have customised single.php quite extensively and there are a few elements that I do not want my ...
0
votes
1answer
74 views

How can I fix this code [duplicate]

Possible Duplicate: Stackoverflow type of badge plugin giving warnings in Wordpress 3.5 I'm getting an error on my site that says: Warning: Missing argument 2 for wpdb::prepare(), called ...
6
votes
2answers
353 views

How to check if image is already stored in a site's post database? (network)

I currently have configured Wordpress so that a post can be copied to other sites within a Wordpress network. However, a post may be broadcast more than once, and I want to check if the image is ...
1
vote
2answers
748 views

Trying to get property of non-object “ wordpress ”

My WP theme got these notice on description menu function my code : http://www49.zippyshare.com/v/89513423/file.html /* Discription Navigation Menu, Credit to Christian Kriesi */ class ...
-1
votes
1answer
836 views

Open WordPress Page from selected option dropdown

Code/process to get option dropdown menu selection to open page in WordPress with php? Tried all kinds of plug-ins, widgets, but none will make menu that fits requirements of project so far. ...
-1
votes
2answers
135 views

Fix incorrect related posts code snippet

Can anybody fix this incorrect related posts codes snippet? function related_posts() { if (is_single()) { global $post; $current_post = $post->ID; $categories = get_the_category(); ...