wordpress-theming

Make tag show as dropdown in woocommerce

十年热恋 提交于 2020-01-25 21:40:08
问题 Hi this is the code to the wordpress shown tags: <label><?php _e('Tags', PLSH_THEME_DOMAIN); ?>:</label> <?php foreach($tags as $tag) { echo '<a href="' . plsh_assamble_url($shop_page_url, array('product_tag=' . $tag->slug), array('product_tag')) . '"'; if(plsh_get($_GET, 'product_tag') == $tag->slug) echo 'class="active"'; echo '>' . $tag->name . '</a>'; } ?> I want to make this shown as drop-down menu but I can not figure it out :( can someone help me pls 回答1: <label><?php _e('Tags'); ?><

Custom output wp list category

牧云@^-^@ 提交于 2020-01-25 00:08:06
问题 Here is the output from the wp list categories: Personal Area Allergy Asthma Dust Restaurant Cafe Bar Chemical & Smoke Airport Dump & Mold Pet & Dander Commercial Area Commercial child 1 Commercial child 1-2 Commercial child 1-3 Commercial child 2 Commercial child 2-1 This is my code on front-page.php <?php wp_list_categories('taxonomy=product_category&hide_empty=0&orderby=id&title_li=');?> The category have 2 depth child. I want to custom the output html with background images each

How to keep custom wordpress page templates in different folder other than the theme folder

99封情书 提交于 2020-01-24 23:05:12
问题 I have many custom wordpress page templates and I want to keep them in different folder. Like /pages/ But, the problem is when I keep them in different folder other than the theme folder, the custom page options disappear from wordpress page template menu. How can I keep the page templates in different folder and still access them in wordpress page templates menu ? 回答1: You want to use a child theme. http://codex.wordpress.org/Child_Themes 回答2: I actually found you can in WordPress 3.1+, at

Adding two sidebars in wordpress child theme

廉价感情. 提交于 2020-01-23 03:44:47
问题 In Wordpress I want to make two sidebars. One will be in left hand side of the content and the other one will be in the right hand side (default sidebar) in twentyelven theme. For that I made little bit customization to my twentyeleven child theme. In functions.php I made this changes register_sidebar( array( 'name' => __( 'Left Hand Sidebar', 'buygames' ), 'id' => 'sidebar-left', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3

Path to WordPress Template Directory inside jQuery?

烈酒焚心 提交于 2020-01-19 22:37:29
问题 My header is calling a javascript file which sends out an email: <script type="text/javascript" src="<?php bloginfo('template_directory') ?>/css/effects.js"></script> But inside this file, I have a jQuery code that calls a .php file that does the actual sending of the email: $.ajax({ type: "POST", url: "css/sendmail.php", data: dataString` But the script doesn't work, unless the url is: <?php bloginfo('template_directory') ?>/css/sendmail.php and not just: css/sendmail.php Is there any way to

How to retrieve posts(books) based on category(taxonomy) in wordpress?

孤人 提交于 2020-01-18 00:02:33
问题 I am trying to display posts of specific category(taxonomy) that is 'Book1'. I tried to display it with the following code. $args = array( 'post_type' => 'book', 'posts_per_page' => 6, 'tax_query' => array( array( 'taxonomy' => 'Book1', 'field' => 'id', 'terms' => 1 ) ) ); echo '<br>'; $postss = get_posts( $args ); if ( ! empty( $postss ) && is_array( $postss ) ) { // Run a loop and print them all $i=1; foreach ( $postss as $termm ) { echo ' '.$i.' '.$termm->post_title. '<br>'; $i++; } } ?>

How to retrieve posts(books) based on category(taxonomy) in wordpress?

梦想的初衷 提交于 2020-01-18 00:02:11
问题 I am trying to display posts of specific category(taxonomy) that is 'Book1'. I tried to display it with the following code. $args = array( 'post_type' => 'book', 'posts_per_page' => 6, 'tax_query' => array( array( 'taxonomy' => 'Book1', 'field' => 'id', 'terms' => 1 ) ) ); echo '<br>'; $postss = get_posts( $args ); if ( ! empty( $postss ) && is_array( $postss ) ) { // Run a loop and print them all $i=1; foreach ( $postss as $termm ) { echo ' '.$i.' '.$termm->post_title. '<br>'; $i++; } } ?>

Child theme doesn't read template part file

天大地大妈咪最大 提交于 2020-01-17 16:36:26
问题 I'm building my first child theme. My child theme is my active theme at the moment. So, I have a file under the parent theme which is at wp-content/themes/mytheme/template-parts/ajax-mytick-list.php and I copied it to wp-content/themes/mytheme-child/template-parts/ajax-mytick-list.php and edit it there. But the site is not showing the one that I edited under child theme. Cos if I edit the same file in parent theme, the result is reflected. What am I doing wrong? 回答1: You can override page

WooCommerce shows the placeholder image when using get_image()

不想你离开。 提交于 2020-01-17 06:17:39
问题 I am developing a custom WooCommerce theme and every time I try to retrieve a product's image, all I get is the placeholder image. I've already set the image in the back-end so it should work properly, but it doesn't. Here is my code: $args = array( 'post_type' => 'product', 'posts_per_page' => 2 ); $products = get_posts($args); foreach($products as $the_product) { $wc_product = new WC_Product($the_product->id); echo $wc_product->get_image('shop_thumbnail'); } This is the result: Could you

Adding email subscription to Wordpress theme

梦想与她 提交于 2020-01-17 01:30:07
问题 I've developed my own Wordpress theme and I wanted to give users the ability to subscribe to my blog. I have the typical Post RSS and Comment RSS options that come with Wordpress under the META section of the sidebar, but I also wanted to give my readers an option to just input their email address and press a button to "subscribe". I know this is possible since I've seen many many blogs that use this, and if needed I can list some here. But I'm not sure if this is a plugin or a widget or what