wordpress-theming

how to used wordpress function inside the custom function?

天大地大妈咪最大 提交于 2019-12-26 12:13:15
问题 <?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

wordpress json_decode is not working, I am trying to get value form wp_option table

青春壹個敷衍的年華 提交于 2019-12-26 06:04:15
问题 When I am trying to decode JSON with this code the output is ArrayArray ( [0] => ) I do not know why WordPress doesn't support this <?php global $wpdb; $mylink = $wpdb->get_results( "SELECT option_value FROM wp_options WHERE option_id=62167", ARRAY_N ); $raw = stripslashes_deep($mylink); $data = array(); foreach ($raw as $json) { echo $json; $item = @json_decode($json, true); $data[] = $item; print_r($data); } ?> 回答1: Hello you need to unserealize the data first when your query get data from

How to load custom php file in Wordpress themes

♀尐吖头ヾ 提交于 2019-12-25 10:19:17
问题 I've just created a website using wordpress and a custom theme for it. This is my theme directory /themes/customtheme/ -index.php -header.php -footer.php -blog.php .... The index.php includes header , footer ,information to shown on my website, and a link to my blog page. Blog file will looks same as normal blog site. May i know how to write a hyperlink(a href) in index.php under theme directory so that it can prompt to the blog.php when click? 回答1: If I understand well your question you need

How to load custom php file in Wordpress themes

感情迁移 提交于 2019-12-25 10:19:04
问题 I've just created a website using wordpress and a custom theme for it. This is my theme directory /themes/customtheme/ -index.php -header.php -footer.php -blog.php .... The index.php includes header , footer ,information to shown on my website, and a link to my blog page. Blog file will looks same as normal blog site. May i know how to write a hyperlink(a href) in index.php under theme directory so that it can prompt to the blog.php when click? 回答1: If I understand well your question you need

wp paginate_links and query vars not working Wordpress

喜你入骨 提交于 2019-12-25 08:17:22
问题 I am trying to make custom query integrated with a plugin to sort posts. Here's the code. index.php $view =$_GET["sort"]; if($view == "views"){ if ( have_posts() ) : $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args = array('post_type' => 'post', 'meta_key' => '_kksr_avg', 'orderby' => 'meta_value', 'order' => 'desc', 'paged' => $paged, 'posts_per_page' => 5); $query = new WP_Query($args); while ( $query->have_posts() ) : $query->the_post(); // code for display posts

my taxonomy-$taxonomy.php page post not show?

こ雲淡風輕ζ 提交于 2019-12-25 07:34:38
问题 I created a custom post taxonomy.Now i want to show all specific post by specific taxonomy. so I created a taxonomy-product_cat.php page. here is product page get term and link code-- <div class="side_box side_box_1 red5"> <h5><a href="#" class="tgl_btn">Filter Products</a></h5> <h6>Brand</h6> <?php $topics = get_terms('product_cat'); echo '<ul class="advanced-filters tgl_c">'; foreach ($topics as $topic) { echo '<li class="advanced-filter" data-group="Brand"><a href="'.get_term_link($topic).

Conditionally display menu for page type in Wordpress

老子叫甜甜 提交于 2019-12-25 06:28:18
问题 I am relatively unfamiliar with Wordpress and I am creating a custom theme for a client. I would like to either display or remove the main menu depending on the page type. I have researched several options like removing the navigation from header.php and referencing it separately and also making the menu conditional which is preferable. I have a custom page type in my theme called 'landing page' on which I would like the menu to be never be displayed, though it will be on every other page.

how to get popular posts fro selected categories in wordpress?

ⅰ亾dé卋堺 提交于 2019-12-25 04:18:08
问题 I am trying to get popular posts using the coment count. I also want to exclude some categories from the query. Any idea how this can be achieved. What would be query to exclude particular categories? for example i want the query should not include category names health and auto SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS 'stammy' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish'

Creating an interactive map with wordpress [closed]

吃可爱长大的小学妹 提交于 2019-12-25 03:38:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I 'm in the research stage to create a interactive map like http://www.locksmithdirectory.com/ ! using themes or plugins ! 回答1: You could try to use the Google Geochart API to create a similar map. It allows to create interactive maps and to capture click events. You can find more information and examples here:

How to include bower_components files (CSS/JS from any framework) in END PRODUCT that i need to deploy to GIt ot Client?

雨燕双飞 提交于 2019-12-25 01:09:34
问题 I have a Gulp setup. In which i have setup bower for components. I am using these three files just to test the setup 1) Jquery 2) Owl Carousel 3) Font Awesome The problem is that when i have completed my project i want to submit the files to a repository like Git or to a client or to upload to my client's site as WordPress theme. But as like npm_modules folder i need to deleted my bower_components folder from it and then submit it. But when i will submit things like that to a server like as a