10
votes
5answers
2k views

How do you use a CPT as the default home page?

I have a client who's site will be making heavy use of custom post types to configure their site. But I'm between a rock and a hard place for their requested home page. In reality, the home page ...
8
votes
6answers
4k views

How to *remove* a parent theme page template from a child theme?

I'm using the TwentyTen theme to create a child theme, but I can't seem to get rid of the 'One column, no sidebar' page template that is in the TwentyTen parent theme. I thought just copying it over ...
7
votes
2answers
7k views

What is the correct way to use wordpress functions outside wordpress files?

I read about 2 methods for initializing wordpress function outside of wordpress files so We can use these functions on any page or website outside the wordpress blog. Which one of these 2 methods is ...
6
votes
1answer
2k views

How to show 'login error' and 'lost password' on my template page?

I'm providing front-end login in a template, using the function wp_login_form. It handles the redirection after login and logout pretty neatly! But if the username / password mismatch, or are non ...
5
votes
1answer
4k views

Form to Add Posts to Custom Post Type

Basically I want to display a form on my blog (on a certain page) that will allow anyone to fill it out and it will create a post in a custom post type. I saw the answer once before but I can't find ...
10
votes
3answers
2k views

Adding admin-ajax.php to the frontend. Good or bad idea?

I love admin-ajax.php. But I hate having to localize in order to point frontend scripts to it, and I wish there was an equivalent, easy-to-find file for themes. (It also just bothers me to see ...
2
votes
1answer
1k views

How to quickly switch custom post type singular template?

I have a custom post type called movies and I need to quickly switch the template that displays the movies cpt on the front end via a link. How can this be done? Files I have: single-movies.php ...
6
votes
2answers
532 views

Set custom name for generated thumbnails

Is there any filter available to set the naming convention of those auto generated thumbnails? Something like this: thumbnail_150x150.jpg -> thumbnail-s.jpg thumbnail_300x300.jpg -> ...
5
votes
1answer
2k views

How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button

I have a custom post type (called contacts). Since this post type is not working like a post, I don't want to show SAVE DRAFT, PREVIEW, Status, Visibility or Publish Date. The only options I want to ...
4
votes
7answers
3k views

What are options are there to implement a multi language site

What is the best way to have multiple languages on a site? I was thinking of using WP3.0 and then having each language of the site being a seperate blog in a sub directory. I.E. example.com ...
3
votes
4answers
5k views

How to restrict access to uploaded files?

I have a restricted area on a website that can only be accessed by logged in users. For that I created a page template with a 'current_user_can()' condition. My problem is that the documents attached ...
3
votes
1answer
4k views

Remove parent category from permalink? Basically only have the child category?

I think there used to be an out-dated plugin to do this. Is there any way to do this easily with just a little code? We prefer not to rely on a plugin since that makes us dependent on the developer ...
3
votes
3answers
2k 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 ...
2
votes
5answers
5k views

Change the Author Slug from Username to Nickname

Hi to the community, is it possible to change the default username slug to nickname if is available? By default the url is something like: http://domain.tld/author/(admin) , is it possible to ...
7
votes
1answer
256 views

Two (or more) parallel (sub-)TLDs that are retained when surfing the site / dynamically set the site address?

I am running a site for a German NGO under the domain sub.example.org. Recently, I added sub.example.ch for its Swiss spin-off. Both (sub-)domains are pointing to the same physical location, a WP ...
6
votes
6answers
4k views

Paged posts - how to use numbers and next/previous links?

I want wp_link_pages (mutli-page posts) to display the page numbers, the word "previous" before those numbers, and a "next" after those numbers. It would look like this: Prev 1, 2, 3, 4 Next I'm ...
6
votes
2answers
5k views

Theres a way to use $query->set('tax_query' in pre_get_posts filter?

Theres a way to use $query->set('tax_query' in pre_get_posts filter? for example next code is not altering the query. Note that im building $taxonomies from and custom search. function ...
2
votes
1answer
792 views

How can I display parent and child taxonomies in separate drop downs?

The requirement is where i have a taxonomy State which is the parent and it has a child sub-taxonomies they are the Cities, Need to display the state as a drop down, when i select the particular state ...
2
votes
1answer
2k 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 ...
2
votes
2answers
2k views

How Can I Organize the Uploads Folder by Slug (or ID, or FileType, or Author)?

I want to store all attachments (media) in folders named with each post title. Example: /wp-content/uploads/my-post-about-stuff/ The folder should contain all media attached to that post. Is that ...
0
votes
1answer
4k views

Custom page with variables in url. Nice url with add_rewrite_rule

Using WP3.1 I Have a custom page with a WP_Query and the query gets dynamic variables from the url. And i want safe variables and clean urls. Example: ...
7
votes
2answers
723 views

restore_current_blog() vs switch_to_blog()

After every instance of switch_to_blog() you should call restore_current_blog() to restore the current (actually, previous) blog. But if you're looping through two or more blogs and calling ...
6
votes
2answers
397 views

How do themes provide support for child themes?

One of the requests on themeforest is that themes are required to provide child theme support. I know what child themes are, although I haven't worked a lot with them, but I would like to know is ...
6
votes
2answers
748 views

Looking for a Table of Contents (TOC) plugin for WordPress

I am looking for a simple TOC plugin for WordPress that would create a ToC similar to the one from MediaWiki (Wikipedia). Usually I need this only for big pages and the TOC needs to be generated based ...
5
votes
1answer
341 views

How do I position meta_box on post edit screen after the title?

I am displaying a div in the Edit Post screen using add_meta_box(). This function provides very limited positioning options via "priority" and "context" params and these are not sufficient for my ...
5
votes
3answers
3k views

How to use taxonomies on attachments with the new Media Library?

WordPress 3.5 changed the media management and now the Media Library edit screen uses the default post type UI. Taxonomies are very useful for WP installs with different users and attachments, giving ...
4
votes
2answers
2k views

Why might a plugin's 'do_shortcode' not work in an AJAX request?

tl;dr: Contact Form 7's shortcode doesn't work in an AJAX request when called with do_shortcode functions.php add_action('wp_ajax_ps_get_survey_form', 'ps_get_survey_form'); ...
3
votes
1answer
412 views

Check if post is being published for the first time, or is an already published post being updated

I am building an add-on to an events module that checks for availability, since there wasn't a function for that in that module. Now that I have built the logic, there are three emails I will need to ...
2
votes
1answer
1k views

How do I implement the Wordpress Iris picker into my plugin on the front-end?

This question here is asking the same question as I am, but there were no adequate answers nor a selected correct answer so I am asking again hoping if I ask in a more coherent manner I might get a ...
2
votes
1answer
939 views

How to var_dump nav menu items from anywhere?

I wanna preview all the fields that the nav menu $item array holds. Is there a function to fetch it from anywhere and place it inside var_dump?
2
votes
2answers
5k views

Using $_GET variables in the URL?

I need to generate a simple error message on a page by passing a variable through the URL. The URL is structured as follows: http://site.com/parent-category/category/?error=pause I'm sure it's the ...
2
votes
2answers
6k views

How to redirect a sucessful registration to a page template?

Each time I register I end up in the wp-login page (back-end): Is there any way of redirecting the users who register to a page template (front-end)?
1
vote
2answers
4k views

User Profile / Add Custom Fields

Hello: I am trying to add 7 custom fields to the standard Wordpress wp-admin/profile.php page. There are a few site which suggest a simple bit of code to do this, for example: ...
0
votes
1answer
6k views

Using ajax on categories and wordpress loops

I want my index.php to be a simple page with a horizontal list of category names on the top. But instead of having the page reload with the list of posts in that loop each time a category is clicked ...
4
votes
2answers
2k views

Redesigning Custom Post Type “Add New” page

I've been browsing all over google for a solution to this. I'm writing a custom post types plugin for work to log-in visitors that we get. I initially wrote a mock-up without custom post types, then I ...
2
votes
1answer
1k views

How to use logout function on custom menu link?

All I am using wordpress custom menu, and there is one menu as Logout. I know wordpress Logout function <?php echo wp_logout_url(); ?> But how can i use it in custom menu ?
1
vote
2answers
616 views

Permalinks: custom post type -> custom taxonomy -> post

I am having trouble working with wordpress' rewrite rules, and could use some help. I have a custom post type called shows. All shows have a single custom taxonomy category show-category. A show ...
1
vote
2answers
2k views

Add Comment Custom Field

I searched a lot of thread regarding my problem, but unfortunately I found nothing works, and this my final option. I want to add some custom fields on my comment form. How can I do that?
1
vote
1answer
277 views

wp_enqueue_script isn't connecting my custom js file

I am using wp_enqeue_script to link to a custom.js file in my plugins folder. However I am expecting a link to show up on the page but it doesn't is there something else I am supposed to other than ...
0
votes
2answers
257 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
3answers
4k views

Mapping multiple URLs to same page

I just came across this page with almost similar requirements as mine Multiple endpoints to same page i have to achieve same functionality but i also want to pass some parameters to the page where ...
0
votes
3answers
5k views

Get current term's ID

Im using the following code to get an array of children taxonomies and write them out with links in an unordered list. <?php $termID = 10; $taxonomyName = "products"; $termchildren = ...
5
votes
3answers
485 views

Populate content on install

I would like to know if there's a way to populate a WordPress site with some dummy content while installation process is going on. Let's say a few sample pages, a fews posts, taxonomy and that's it. ...
5
votes
1answer
959 views

Load js/css files only on specific admin UI pages

How do I adapt this solution to work with my plugin? (Please see the link). I enqueue my css and js script as follows: function my_plugin_init() { wp_enqueue_script('my_plugin_script', ...
4
votes
1answer
1k views

How to store widget fields data as an array?

I am creating a widget, it needs to store about 10 IDs. Right now I'm using following field method to store each of the ID in a separate field. It stores data of each field in a separately in the ...
2
votes
2answers
2k views

Combining queries with different arguments per post type

I am building a section on a site where I am merging two different post types into one loop, and then displaying them randomly. The problem is, I'm having a hard time finding a way to limit the amount ...
1
vote
1answer
1k views

How to Make a Custom Dashboard Widget to Display Custom Notification from Admin?

I am looking for a way to achieve the following: A group of users 'students' They login to the site Each student can see a 'Custom Dashboard Widget(s)' Each widget will carry a personal message ...
1
vote
2answers
2k views

Multiple Domain Names - One WP Install (non-Multisite) - Default Each Domain name to Category Archive

Use case is somewhat simple - here goes: Five people share a single wordpress install - not multi-user Each person blogs and puts their posts in a their own unique category Each person has their ...
0
votes
2answers
119 views

How is it possible that the function of the test page works, but it does not go live?

I want to load the new entries without reloading the page. I found a great solution for: The ajax script: <script> $(document).ready(function() { var refreshId = setInterval(function() ...
0
votes
4answers
443 views

I want only my sub-pages to be clickable in the navbar

I am building a simple website with a number of pages, each of which is grouped. Let's say my website has roughly 20 pages, grouped into 5 categories. So I want my navbar to display the 5 categories, ...

15 30 50 per page