wordpress-theming

Wordpress Theme Customizer - Add area for users to move around and organize widgets

纵饮孤独 提交于 2019-12-04 04:21:27
I am currently developing a Wordpress Theme, using the Theme Customizer to let users customize it, but I have got stuck. For the footer, I have created various widgets, containing different things like Recent Posts, or a Live Twitter Feed. I want the users to be able to organize them, in the order they want, yet I cannot work out how to do it. I found one other theme (Zerif Lite), that lets you do this (see image below), however I went through all the code and couldn't work out they did it, there was nothing adding the 'Our focus section widgets' section. I have organized my theme similarly,

Wordpress - Custom taxonomy page of custom post type listing by terms

五迷三道 提交于 2019-12-04 03:56:34
I have a taxonomy-taxonomy.php page that needs to look like so: CUSTOM POST TYPE TITLE (RESOURCES) Custom Taxonomy 1 (Resource Types) Resource Type Term 1 (White Papers) White Paper post 1 White Paper post 2 White Paper post 3 Resource Type Term 2 (Videos) Videos post 1 Videos post 2 Videos post 3 Tried to make sense of all the new documentation for Wordpress 3.0, but it only made me more confused as it seems to be mixed up with 2.8. It's not necessary to transform the object to an array, you can perfectly work with the object without too much hassle. What is curious (at least for me), is that

Replacing the home link in woocommerce breadcrumbs

妖精的绣舞 提交于 2019-12-04 02:31:22
问题 I know its a bit of a daft question, but like a fool I just cant find the right answer. At the moment this is what my breadcrumbs look like Home / Male Voice overs / Derek Doyle I need to change the home link name to Voice Overs and link it to another page. Please any help would be great. Thanks 回答1: Woocommerce provides filters for this. add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_home_text' ); function jk_change_breadcrumb_home_text( $defaults ) { // Change the

how to show user's username when logged into a wordpress site?

冷暖自知 提交于 2019-12-03 20:25:02
I would like to have the header of my site reading "Logged in as " when a user is logged into my wordpress site. I dont know how to echo the username of the current user, heres the code I'm got... <?php if ( is_user_logged_in() ) { echo '<ul id="mem" class="clearfix"> <li><a href="#">Logged in as Username</a></li> <li><a href="#">Logout</a></li> </ul>'; } else { echo '<ul id="mem" class="clearfix"> <li><a href="#">Register</a></li> <li><a href="#">Login</a></li> </ul>'; } ?> and I'd like to replace Username. Any help is much appreciated. Thanks, Mark you can use get_currentuserinfo() function

Best Practice for Including JS (with PHP) in WordPress Functions file

£可爱£侵袭症+ 提交于 2019-12-03 16:14:10
I'm building a custom WordPress theme and have a quick question regarding WordPress and the Functions.php I've got 500 lines of jQuery that run for a portion of my custom theme admin panel. The jQuery code is located inside of my functions.php file, called when the custom admin menu page is displayed. Ideally, I would like to move the JavaScript out of the functions.php file and use wp_register_script + wp_enqueue_script, but I also have some php code mixed in with the script. See below: //Function that Provides Options within the Menu Page function quz_custom_theme_options(){ global $quz

In Wordpress, how do I set the default admin sort order for a custom post type to a custom column?

ぐ巨炮叔叔 提交于 2019-12-03 11:00:55
问题 I've set up a custom post type called clientarea, and set up several custom columns for it in the admin area - the custom columns are all custom meta fields, as you can see from my code. I'd like to sort by 'Appointment Date' descending by default. All of the columns work fine, and can be sorted manually as expected, but I can't get the default sort order to work. If I change the default sort field to a standard field (e.g. 'title') it works as expected; it only seems not to work when I'm

Wordpress theme upload error PCLZIP_ERR_BAD_FORMAT

放肆的年华 提交于 2019-12-03 10:50:25
问题 I'm new to php as well as wordpress however because of some need I had to work with wordpress only. So just to start I read a tutorial and created a wordpress theme of my own and when I tried to upload my theme I got the below error: The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature Searching for the same I've found that usually the cause of such an error is maximum available space or upload file size issue. However since I'm

Template Dropdown not showing up within Wordpress administrator page

我的未来我决定 提交于 2019-12-03 09:38:48
问题 I am working on a Wordpress-based project, and I just added a new template to the installation by uploading a template file. I was creating a new page that will use my new template, when suddenly, the "Template" dropdown in the "Page Attributes" box is gone. I am using Wordpress 3.0.1. Update: I saw a site which told me to revert to the default template, and back to my custom template. Apparently it worked, but I am still baffled on what triggers this bug. Also, any additional knowledge or

WordPress 3.5 Media Uploader Multiple File Select

泄露秘密 提交于 2019-12-03 06:11:33
I'm building a WordPress theme with a custom settings page. Some of the settings require the user to upload/add a set of images (more than 1). The default behavior of the media uploader is to upload and/or select a single image and insert it into a post. I've followed this excellent guide on utilizing the media uploader, and it suggests that I should be able to set multiple to true, but it still only allows for a single file to be uploaded or selected. Here's my code: Load in the needed scripts since this is a custom settings page: if(function_exists( 'wp_enqueue_media' )){ wp_enqueue_media();

How do I remove a taxonomy from Wordpress?

不打扰是莪最后的温柔 提交于 2019-12-03 05:39:14
问题 I'm creating different custom post types and taxonomies and I want to remove the 'Post Tags' taxonomy from the default 'Posts' post type. How do I go about doing this? Thanks. 回答1: I suggest you don't mess with the actual global. Its safer to simply deregister the taxonomy from the post type: register_taxonomy is used for both creation and modification. function ev_unregister_taxonomy(){ register_taxonomy('post_tag', array()); } add_action('init', 'ev_unregister_taxonomy'); To remove the