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

learn more… | top users | synonyms (1)

1
vote
2answers
2k views

How do I make wordpress comment fields required?

Here is my form: <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" class="validate"> <?php if($user_ID) : ?> <?php ...
1
vote
1answer
388 views

Why does this echo values in the wrong order?

I'm sure there is a simple reason/answer for this: Why does echo 'Archive for '. the_time('Y'); give me 2010Archive for? I had expected it would give me Archive for 2010
1
vote
1answer
190 views

Prevent WordPress from loading comments

I'm displaying the comments for a post my way, using $comm = get_comments() and then passing $comm to wp_list_comments() (this is the reason why). How to disable WordPress from loading comments from ...
0
votes
2answers
34 views

Looking to exclude blog posts from category Previous/Next buttons

I'm working on some conditional elements here and I thought I had it but it's still not working right. You can see my site here. What I've done is displayed only category Legal Libation Columns (98) ...
0
votes
1answer
20 views

Second select list values are not saved after clicking update

I have a select list in a metabox which value is saved successfully after clicking "Update" when editing post. Of course, the values are custom taxonomies. But i don't know how to add another select ...
0
votes
0answers
47 views

Would manually deleting the dumping data fix a “#1062 - Duplicate entry '1' for key 'PRIMARY'” phpMyAdmin error?

I'm new to PHP! I'm trying to import an SQL database file into myPhpAdmin for a WordPress I'm migrating, but I keep getting this error message: SQL query: `-- -- Dumping data for table ...
0
votes
0answers
23 views

Separation of view and logic

I find that very easily my views become cluttered with logic, e.g. null checks, email validation, and retrieving values from the post object. How would you separate this out in Wordpress? Is there any ...
0
votes
0answers
44 views

How to validate datepickers before publish

I have two datepickers in my post: 1. start_date and 2.end_date Basically, I need to check if end_date is greater than start_date before I can proceed to publish. From a previous solution here, I ...
0
votes
2answers
89 views

Why isn't my if/elseif/else working correctly here?

I am using a simple if/elseif/else bit of code to generate a header image for my page, I can't seem to understand why it isn't working properly. It determines the category of the page being displayed ...
0
votes
2answers
195 views

Nice scroll to wordpress

I am converting html5 to wordpress Theme. I want to use custom scroll for wordpress. The code DEPENDENCIES It's a plugin for the jquery framework, you need to include jquery in your scripts. I will ...
0
votes
1answer
151 views

Is it possible to get a theme customizer setting from wp.customize using jquery?

I am wondering if it is possible to directly interop with the wp.customize api to get a value of a theme customizer setting. The way I am doing it now is using ajax to get a response from a php ...
0
votes
0answers
390 views

Twenty Fourteen Customization: Link Post Formats

A solution for this issue for the previous default theme, Twenty Thirteen, was found by me here. It's perfect for what I'm trying to do: set my own desired URL as the link in the title, rather than ...
0
votes
3answers
627 views

How can I loop into two different DIVS without repeating the DIVs

I am having a little trouble trying to figure out how I can accomplish this: I have a container with two colums in it, a right and a left column. Each column will have 3 posts with a short excerpt ...
0
votes
2answers
44 views

Wordpress theme & site not loading after moving files

I was recently created a custom application for wordpress. So while doing so in my file manager (I use the one provided by godaddy(my webhost)), I moved all the files from the [DOCUMENT_ROOT] ... the ...
0
votes
3answers
208 views

Custom Loop Pagination on WordPress

I'm trying to create a magazine style website. For this particular page (not homepage) I'd like to fetch the latest post and style it one way (style1). For all the other posts I'd like to just display ...
0
votes
2answers
120 views

How to allow PHP In WordPress text widget

I want to add a text widget to my new WordPress website, but in the text widget there are some PHP snippets and I am finding it difficult to do it. Please help me Guys.
0
votes
1answer
124 views

display most popular tags in two columns

I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however ...
0
votes
1answer
665 views

Loading wordpress stuff on laravel site

I not sure why i failed to load the wordpress site on the laravel site. the following code, i tested on plain php without any framework - it work! but if i call from the file within laravel framework ...
0
votes
1answer
33 views

date function not correctly returning date

This code is being used to generate the date of a post in wordpress: <span class="the_date">Posted: <?php echo get_the_time('F d, Y'); ?></span> However it is not resutning the ...
0
votes
1answer
101 views

Do I require the use of nonce?

Im creating a visit/page views counter with ajax,jquery and php, I have been reading a few articles that recommend the use of nonces for data manipulation through ajax, however i am not sure if i need ...
0
votes
1answer
81 views

Get a Page's attachments in Gallery order

Having created a page and a gallery within that page, I would like to retrieve all the images in that gallery in the order they are set when the gallery is created, i.e. the order which I drag them in ...
0
votes
2answers
357 views

Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)

I've searched a lot for this and I seem to get different answers. In my situation, my jQuery function has to use a PHP variable from a different file. How can I accomplish this? Clear and simple ...
0
votes
2answers
406 views

Two posts in same div - WP loop

I would need the following in Wordpress: <div class="posts-wrapped"> <div id="post-1" class="post"> <h1>Title 1</h1> </div> <div id="post-2" ...
0
votes
1answer
93 views

Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin - Adding to “Thoughts” Theme

How do I enable infinite scroll (either with the infinite-scroll plugin OR the built in infinite scroll jetpack) on the "Thoughts" Wordpress theme? I'm a total noob at editing this stuff so if you ...
0
votes
2answers
87 views

JS completely stopped loading but Files are found

Basically I've enqueued all of the files I need and can see there been picked up in the browser but for some reason none of them seem to load or function correctly and I get no errors in the console. ...
0
votes
2answers
39 views

conditional statement expressing that current user didn't logout (is still in the same login session)?

Thank you in advance for your time. I want to perform the following conditonal if: if (current user didnt log out and is in the same login session ) { Do_something; } How to express it using ...
0
votes
2answers
124 views

Get used terms by an author as array of strings

I am using list_author_used_terms function below to get the terms used by a specific author (terms of a custom taxonomy 'wossom' for a custom post type 'aya-bi-aya'). function ...
0
votes
1answer
488 views

How to send “Location” header on plugin form submit event?

How to redirect to specified page after form was submitted? Warning: Cannot modify header information - headers already sent by (output started at wordpress\wp-admin\menu-header.php:94) in ...
0
votes
1answer
570 views

Search that will look in custom field, post title and post content

I am looking for a way to perform a search, and while performing the search, it checks a custom field named keywords, the post title and the post content. If any of those fields have results like what ...
0
votes
1answer
104 views

Twitter feed is showing blank in WP site [closed]

I am using themefuse WP theme and facing this problem. http://themefuse.com/forum/thepractice-wp/twiiter-newsline-is-blank Can someone please suggest if I need to use some other attribute. I am not ...
0
votes
1answer
142 views

Adding Image Count to Multigallery

Ok so I am using the [multigallery] function and it works fine, but one thing I want to add. Here is the code that I am using for the multigallery in my functions.php file function ...
0
votes
1answer
140 views

Adding a user's ID behind the <a> tag ref link address

Good day, everyone: I want to make wordpress to add the user's id number behind the ref's link string, so that, for example <div class="toolsbutton"> <a ...
0
votes
1answer
205 views

Changing Link Attributes for Wp_Link_Pages

I'm wondering if there is any way to change the actual link itself for wp_link_pages. So right now, I have a simple code to display the pagination for a post, it looks like this: <?php ...
0
votes
1answer
182 views

Post from one loop in different containers?

Is there a way to output posts from a single loop in multiple containers? Ideally I'd like to have the posts title/meta/content etc alternate between first-container and second-container, but I can't ...
0
votes
3answers
416 views

How to store accumulate multiple option values in a single array using Options_API

I have created an option array that stores a series of options, along with their values. The problem is that I want to ACCUMULATE these options and store them in the options database. Meaning I would ...
0
votes
3answers
627 views

How to Create a Directory in a Plugin Folder?

I am creating a plugin in WordPress Version 3.4.2. When the administrator submits a form, a new folder is created inside my plugin directory and a file saved in this new folder. But it gives me the ...
0
votes
1answer
264 views

Setup page template array in a custom post type

Hi below is a 'case' (in a custom post type) for pulling all categories and displaying them as a drop-down menu. How can I do the same but turn it into a list of checkboxes? //tax_select - this ...
0
votes
1answer
386 views

Alter secondary loop to exclude posts from current page category

The below code is taken from sidebar.php where it outputs random posts from multiple categories and excludes the current post from showing up. This works great but how do I alter this loop to exclude ...
0
votes
1answer
1k views

Adding a unique class to wp_nav_menu

How would I go about adding a unique class to the direct child li elements of the main parent ul element generated with wp_nav_menu? <nav id="access" role="navigation"> <div ...
0
votes
1answer
181 views

Creating a WordPress shortcode

I'm coding my first WP shortcode and am having trouble turning my working PHP into a working shortcode. I have successfully created a basic shortcode that returns text in the spot I'd like so that ...
0
votes
1answer
2k views

How to call a function only once (global variable scope)

I have been trying to work out the most effecient way to use functions in WordPress. I have a big slow function big_slow_function() that ideally is only run once. But I need to use the boolean that ...
0
votes
1answer
571 views

How to create different menu's for not logged in visitors and for logged in members?

I'm creating a website which will provide services to members and I want to make it so that when a not logged in person comes to the website the menu is specifically designed for sales pages to make ...
0
votes
1answer
1k views

Using 'strtotime' function to convert a custom-meta-box to a date-stamp

I am building a "podcast" post type in a wordpress build using custom-post-types, meta-boxes & taxonomies. There may be a simpler way to do this.. I'm still learning and this is my first go at ...
0
votes
2answers
1k views

Make Current/Active Page Number a Link (WP_LINK_PAGES)

With the default wp_link_pages the current/active page number is not a link. I would like to find a code/hack which turns the current/active page into a link to the top of the page. I am already ...
0
votes
1answer
325 views

MySQL query performed 4 times inside loop

I have enabled custom php in my pages through the use of the exec-php plugin so I can run more complex pages than the standard WordPress page. I have had no problems with this plugin so far. I have ...
0
votes
2answers
2k views

How to show only parents subpages of current page item in vertical menu?

I just can't find a way to make it possible to show only current parent items down to current page item in a vertical menu the "wordpress way". What I want to achieve is the following dynamic ...
0
votes
1answer
3k views

List page for custom post type?

I have created a custom post type in wordpress and have 90% of the functionality working correctly, but I am having a bit of trouble trying to create a custom listing page template. Currently it is ...
0
votes
2answers
245 views

If Statement Post Formats: No post format selected

I'm working with post formats, most of my code looks similar to this: if ( has_post_format( 'standard' )) { echo '<?php get_sidebar(); ?>'; } if ( has_post_format( 'aside' )) { echo 'this ...
0
votes
2answers
782 views

Best way of adding CSS which can be manipulated by the user via theme option panels?

I thought about adding it as inline CSS with code from the functions.php (not really sure how to do it). Something like this: function addcss() { background: $this_is_the_css_value; } I would ...
0
votes
0answers
92 views

WordPress Tag Page Hook?

Is there any hook for a tag page, so I can alter it's content before outputting?