wordpress-theming

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-31 17:25:04
问题 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

WooCommerce - where can I edit HTML generated by hooks?

我与影子孤独终老i 提交于 2019-12-31 08:08:10
问题 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

How to go about modifying the Wordpress “Pages Add New Screen”

末鹿安然 提交于 2019-12-29 01:22:33
问题 I have been thinking about developing my own theme framework for worpdress. I'd like to use jquery ui to build a bootstrap 3.0 drag and drop interface, which I already have worked out, but I can't figure out how to edit the "Pages Add New Screen" as referenced here: https://codex.wordpress.org/Pages_Add_New_Screen Would I add files to my client side theme that affected my admin structure as well? Does anyone have any suggestions as to how to do something like this. Alot of themes these days

How do I generate a custom menu/sub-menu system using wp_get_nav_menu_items in WordPress?

*爱你&永不变心* 提交于 2019-12-28 08:09:03
问题 I have an html structure that requires customization of the wp_nav_menu code. This is the html I need to generate: <ul class="main-nav"> <li class="item"> <a href="http://example.com/?p=123" class="title">Title</a> <a href="http://example.com/?p=123" class="desc">Description</a> <ul class="sub-menu"> <li class="item"> <a href="http://example.com/?p=123" class="title">Title</a> <a href="http://example.com/?p=123" class="desc">Description</a> </li> </ul> </li> <li class="item"> <a href="http:/

How do I generate a custom menu/sub-menu system using wp_get_nav_menu_items in WordPress?

ⅰ亾dé卋堺 提交于 2019-12-28 08:08:17
问题 I have an html structure that requires customization of the wp_nav_menu code. This is the html I need to generate: <ul class="main-nav"> <li class="item"> <a href="http://example.com/?p=123" class="title">Title</a> <a href="http://example.com/?p=123" class="desc">Description</a> <ul class="sub-menu"> <li class="item"> <a href="http://example.com/?p=123" class="title">Title</a> <a href="http://example.com/?p=123" class="desc">Description</a> </li> </ul> </li> <li class="item"> <a href="http:/

How to get the current page name in WordPress?

ぐ巨炮叔叔 提交于 2019-12-27 12:51:10
问题 What php code can be used to retrieve the current page name in a WordPress theme? All the solutions I have seen so far ( the_title() , get_page()->post_name , get_post() , etc) don't work for a page that contains post entries. They will all return the name of the latest blog entry. Stated another way, assume that you have a page created in WordPress with the name "My News". This page is set as the "post page". Add a couple of posts to the page. Now, what API can be used to retrieve the string

How to get the current page name in WordPress?

*爱你&永不变心* 提交于 2019-12-27 12:51:07
问题 What php code can be used to retrieve the current page name in a WordPress theme? All the solutions I have seen so far ( the_title() , get_page()->post_name , get_post() , etc) don't work for a page that contains post entries. They will all return the name of the latest blog entry. Stated another way, assume that you have a page created in WordPress with the name "My News". This page is set as the "post page". Add a couple of posts to the page. Now, what API can be used to retrieve the string

how to used wordpress function inside the custom function?

南楼画角 提交于 2019-12-26 12:14:43
问题 <?php function tms_footerWidget(){ global $wpdb; $results = $wpdb->get_results( "SELECT `tms_footerColumns` FROM `wp_tms`"); foreach ($results as $row) { $tms_footerWidget = $row->tms_footerColumns; } $colsOne="<div class=\"col-xs-12 col-md-12 col-sm-12\"><div class=\"thumbnail\"><?php dynamic_sidebar('tms_footer2'); ?></div>"; return $colsOne; } ?> and after i have used this function in my html code and i run my php page at that that time these function could not working ..so i see in

how to used wordpress function inside the custom function?

六月ゝ 毕业季﹏ 提交于 2019-12-26 12:14:37
问题 <?php function tms_footerWidget(){ global $wpdb; $results = $wpdb->get_results( "SELECT `tms_footerColumns` FROM `wp_tms`"); foreach ($results as $row) { $tms_footerWidget = $row->tms_footerColumns; } $colsOne="<div class=\"col-xs-12 col-md-12 col-sm-12\"><div class=\"thumbnail\"><?php dynamic_sidebar('tms_footer2'); ?></div>"; return $colsOne; } ?> and after i have used this function in my html code and i run my php page at that that time these function could not working ..so i see in

how to used wordpress function inside the custom function?

梦想的初衷 提交于 2019-12-26 12:13:50
问题 <?php function tms_footerWidget(){ global $wpdb; $results = $wpdb->get_results( "SELECT `tms_footerColumns` FROM `wp_tms`"); foreach ($results as $row) { $tms_footerWidget = $row->tms_footerColumns; } $colsOne="<div class=\"col-xs-12 col-md-12 col-sm-12\"><div class=\"thumbnail\"><?php dynamic_sidebar('tms_footer2'); ?></div>"; return $colsOne; } ?> and after i have used this function in my html code and i run my php page at that that time these function could not working ..so i see in