• I’m trying to build an mobile app for my site, i missing to access categories fixed in dropdown directly from database or from an php page:
    1) i can’t biuld querry to get it
    2) i tried to run this script in public_html but it’s return
    Fatal error: Call to undefined function get_categories() in /mnt/env/****/development/public_html/test.php on line 9
    `<?php

    include “wp-includes/category-template.php”;

    $args = array(
    ‘hide_empty’ => 0,
    ‘pad_counts’ => true
    );
    $categories = get_categories( $args );
    foreach($categories as $category) {

    if($category->count == 0) {
    echo $category->name.”<br />”;
    } else {
    // do nothing
    }

    }
    ?>`

The topic ‘get categories fixed in dropdown’ is closed to new replies.