Mysql
 sql >> डेटाबेस >  >> RDS >> Mysql

केवल वर्डप्रेस उपश्रेणियाँ दिखाएं

यह कोड आपकी मदद करेगा:

<ul> 
<?php 
 $cats = get_the_category();
 $mycat = $cats->cat_ID;
    wp_list_categories('orderby=id&child_of='.$mycat); 
?>
</ul>

या

<?php
if (is_category()) {
    $cat = get_query_var('cat');
    $this_category = get_category($cat);
    $this_category = wp_list_categories('hide_empty=0&hierarchical=true&orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID."&echo=0");
    if($this_category !='<li>No categories</li>')
    {
     echo '<ul>'.$this_category.'</ul>'; 
    }
}
?>

कृपया मुझे बताएं।

सफलता मिले! :)

  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. PHP के साथ MySQL डेटाबेस से मूल्य प्राप्त करें

  2. DAYOFMONTH () उदाहरण – MySQL

  3. गूगल मैप्स एपीआई का उपयोग करके mySQL डेटाबेस में वर्तमान जीपीएस निर्देशांक भेजें

  4. मैं MySQL में एक विदेशी कुंजी बाधा को अस्थायी रूप से कैसे अक्षम कर सकता हूं?

  5. MySQL वाइल्डकार्ड * और%