wordpress-theming

Wordpress theme upload error PCLZIP_ERR_BAD_FORMAT

时光毁灭记忆、已成空白 提交于 2019-12-03 01:20:15
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 working on localhost I don't think it could be the case. Moreover I've increased the upload_max

WordPress Admin: When placing a Custom Post Type as a submenu of a parent menu, the parent menu link is being overridden by the CPT

那年仲夏 提交于 2019-12-03 00:48:29
I register a Custom Post Type, and I don't want it to have its own menu, instead I want to place it as a submenu of an existing admin menu item called my-custom-parent-page . Here's my code: register_post_type('my_custom_post_type', array( 'labels' => array( 'name' => __('Books', 'mcpt'), 'singular_name' => __('Book', 'mcpt'), ), 'supports' => array('title', 'editor'), 'show_ui' => true, 'show_in_nav_menus' => false, 'show_in_menu' => 'my-custom-parent-page', ) ); It works, meaning that it's properly located under the menu my-custom-parent-page , however now when I click on the parent menu (i

jQuery not working in Wordpress 3.5

喜夏-厌秋 提交于 2019-12-03 00:24:08
问题 So I seem to have an issue with one of my old Wordpress themes. I just brought one of my themes out of the darkness to use as a piece of my portfolio, and immediately realized that my jQuery sidebar has completely stopped working and I'm not sure why. Now mind you, I wrote this bit of sidebar code before WordPress implemented their own 'custom' sidebar implementations (so I'm very unsure if this relates to that but highly doubt it. I think I developed it around the time of Wordpress 3.1). The

Wordpress shortcode preview in tinyMCE

喜夏-厌秋 提交于 2019-12-02 23:28:53
I've written a shortcode and its functioning like it should. Now the hard part: I would like to show the user a preview already in the tinyMCE editor. Loading CSS in the editor is not a problem for me, but i would love to know if it is possible to already process the shortcode within TinyMCE. Thanks! Let the code talk: I'll put a code to add a visual icon for highlight content word(s) shortcode, and you can then implement any other shortcode you want with the same logic, class spot_shortcodes { function spot_shortcodes() { add_action('init', array(&$this, 'init')); } function init(){ // Enable

Finding custom-header.php in file manage on Wordpress Penscratch theme

拈花ヽ惹草 提交于 2019-12-02 20:04:48
问题 My website is www.rosstheexplorer.com. I use Wordpress. I use the Penscratch theme. I have never consciously tweaked / altered file manager. I made a change to the custom-header.php and that change has caused me to be unable to load my site. My webhost (Bluehost) said they could restore the file on file manager if I could tell them the directory for the file. I have no idea what the directory is. I have always accessed the PHP files through Customise -> Appearance -> Editor. Now I can no

jQuery selectmenu wordpress

天涯浪子 提交于 2019-12-02 18:17:16
问题 I am moving a site from normal php to wordpress and currently they use jquery-selectmenu plugin for their select menus. I have tried to enqueu the script in wordpress head with no luck. The scripts from the previous site look as follows. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> <link rel="stylesheet" href="<?php echo $siteurl; ?>css/custom-theme/jquery-ui-1.8.1.custom.css" type="text/css" /> <script type="text

PHP Script Not Running in WordPress Correctly

主宰稳场 提交于 2019-12-02 18:02:56
问题 I recently converted http://usborrow.pizzli.com/apply to a WordPress Page Template for a site. Every other page came out fine, but when I go to http://usborrow.pizzli.com/?page_id=6, the page seems to lose all of its styling. Any support would be appreciated. 回答1: Apparently there's an issue with the relative URL reference. Rather than referencing to the stylesheet with <link href="../css/style.css" rel="stylesheet" type="text/css" /> Try absolute path instead <link href="/css/style.css" rel=

remove li class & id for menu items and pages list

孤街醉人 提交于 2019-12-02 16:46:15
Example of WordPress default CSS class output: <li id="menu-item-55" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-55"> <li class="page_item page-item-37"> The menu and pages list item come with various own li class and id . How to remove them in functions.php file for the menu and for the pages list? You should be able to remove them by hooking into a couple of filters and returning empty arrays or strings rather than new classes or ids: add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); add_filter('nav_menu_item_id', 'my_css_attributes_filter',

WooCommerce - where can I edit HTML generated by hooks?

流过昼夜 提交于 2019-12-02 15:12:17
I'm new to WooCommerce. Anyhow, I want to create my own theme, so I followed the guidelines and copied accross the core template files to /mywordpresstheme/woocommerce/ . That all works great and I'm editing the templates just fine. However, the way hooks and actions work in WooCommerce is baffling me and I can't work out where certain parts of generated HTML are coming from. For example, in content-product.php , there is a hook that gets the image: <?php /* * woocommerce_before_shop_loop_item_title hook * * @hooked woocommerce_show_product_loop_sale_flash - 10 * @hooked woocommerce_template

How do I create different editable sections within a WordPress page?

99封情书 提交于 2019-12-02 14:09:56
I have been building my first theme on WordPress and have run into problem while adding content into different sections. My HTML is somewhat like this, <div id="maintext"> <-- Text --> </div> <div id="products"> <-- Text and Images --> </div> <div id="about_company"> <-- Text boxes --> </div> How do I make sure the content added via the WordPress editor falls under the respective divs ? For the "maintext" div I'll load the content from the page itself but how do I add content to the other 2 divs dynamically ? I searched on a couple of forums and many suggested to add content using widgets, is