logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$50
WP error when migrating from one hosting server to another

I have this website in Japanese, www.us-internship.com which has been hosted by IIJ America. I was trying to move this WP site to godady hosting server and the following
error message came up when changing the DNS server.

?Error message?
Warning: Missing argument 1 for post_is_in_descendant_category(), called in /home/content/98/7370698/html/us-internship/wp-content/themes/us-internship-new/sidebar.php on line 36 and defined in /home/content/98/7370698/html/us-internship/wp-includes/functions.php on line 3653

line 36 of sidebar.php is the following:
<?php if ( is_category() || post_is_in_descendant_category()) { ?>

line 3653 of function.php is the following:
function post_is_in_descendant_category( $cats, $_post = null )

I would appreciate if you can help solving this problem.

Thank you!

This question has been answered.

kensama0814 | 01/31/13 at 8:29pm Edit
Tutorial: How to assign prize money


(13) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    01/31/13
    8:36pm
    John Cotton says:

    post_is_in_descendant_category is expecting at least one parameter - $category defined in the codex as follows:

    (mixed) (required) One or more categories specified by ID (integer), name or slug (string), or an array of these


    So you need to pass something...

  • avatar
    Last edited:
    01/31/13
    8:38pm
    Arnav Joy says:

    can you show me your functions.php

  • avatar
    Last edited:
    01/31/13
    8:41pm
    Arnav Joy says:

    see following

    line 36 of sidebar.php is the following:
    <?php if ( is_category() || post_is_in_descendant_category()) { ?>

    and replace it with

    line 36 of sidebar.php is the following:
    <?php if ( is_category() || post_is_in_descendant_category(get_query_var('cat'))) { ?>

    and then see if error goes.

  • avatar
    Last edited:
    01/31/13
    8:47pm
    Arnav Joy says:

    share your sidebar.php please

  • avatar
    Last edited:
    01/31/13
    8:55pm
    Arnav Joy says:

    If you'd rather refer to the category by name you can use,

    $category_to_check = get_term_by( 'name', 'fruit', 'category' );


    <?php if ( is_category() || post_is_in_descendant_category($category_to_check->term_id)) { ?>

  • avatar
    Last edited:
    01/31/13
    9:03pm
    kensama0814 says:

    Thank you. here is the sidebar.php
    <div id="side">

    <?php // If is category or subcategory of $cat_id
    if (!function_exists('is_category_or_sub')) {
    function is_category_or_sub($cat_id = 0) {
    foreach (get_the_category() as $cat) {
    if ($cat_id == $cat->cat_ID || cat_is_ancestor_of($cat_id, $cat)) return true;
    }
    return false;
    }
    } ?>
    <?php if ( is_home()) { //???????>

    <?php } elseif ( is_category('internship') || post_is_in_descendant_category(32)) { //????????>
    <h3 id="side_nav_head01">???????</h3>
    <?php } elseif ( is_category('visa') || post_is_in_descendant_category(35)) { //?????????>
    <h3 id="side_nav_head02">????????</h3>
    <?php } elseif ( is_category('testimonial') || post_is_in_descendant_category(30)) { //????>
    <h3 id="side_nav_head03">???</h3>
    <?php } elseif ( is_category('information') || post_is_in_descendant_category()) { //?????>
    <h3 id="side_nav_head04">????</h3>
    <?php } elseif ( is_category('link') || post_is_in_descendant_category(36)) { //??????&????>
    <h3 id="side_nav_head05">??????&amp;???</h3>
    <?php } elseif ( is_category('company') || post_is_in_descendant_category(31)) { //?????????>
    <h3 id="side_nav_head06">????????</h3>
    <?php } elseif ( is_category(33) || post_is_in_descendant_category(33)) { //????????????>
    <h3 id="side_nav_head08">???????????</h3>
    <?php } elseif ( is_category(34) || post_is_in_descendant_category(34)) { //????????????>
    <h3 id="side_nav_head09">To US Employers</h3>
    <?php } elseif ( is_category(60) || post_is_in_descendant_category(60)) { //???????????>
    <h3 id="side_nav_head10">Internship</h3>
    <?php } elseif ( is_category(79) || post_is_in_descendant_category(79)) { //OPT?????>
    <h3 id="side_nav_head11">OPT????</h3>
    <?php } ?>

    <?php if ( is_category() || post_is_in_descendant_category()) { ?>
    <div class="sub_block">
    <?php
    if (is_category()) {
    $this_category = get_category($cat);
    }
    if($this_category->category_parent)
    $this_category = wp_list_categories('orderby=order&title_li=&child_of='.$this_category->category_parent."&echo=0"); else
    $this_category = wp_list_categories('orderby=order&title_li=&child_of='.$this_category->cat_ID."&echo=0");
    if ($this_category) { ?>
    <ul>
    <?php echo $this_category; ?>
    </ul>
    <div class="side_footer">&nbsp;</div>
    <?php

    }
    elseif (is_home()) { //?????? ?>

    <?php } else {// If no current cat query, just get the top level ones using wp_list_categories. ?>
    <ul>
    <?php wp_list_categories('orderby=order&title_li=&depth=1');?>
    </ul>
    <div class="side_footer">&nbsp;</div>
    <?php
    }
    ?>
    </div>
    <?php } ?>

    <div id="enterprise_block">
    <div align="center"><a href="/?cat=61" title="???? ????????????">
    <img src="/wp-content/themes/us-internship-new/images/GlovalExchange-Banner-2.jpg" alt="" border="0" />
    </a></div>



    <h3>????????????</h3>
    <p>??????????????????!<br />
    ????????????????????</p>
    <div id="form_btn03"><a href="<?php echo get_option('home'); ?>/?page_id=50">????????</a></div>
    <div class="detail"><a href="<?php echo get_option('home'); ?>/?cat=33">??????</a></div>
    <div class="side_footer">&nbsp;</div>
    </div>
    <div id="form_block">
    <h3>????????</h3>
    <p>??????????????????????????!
    ???????????????????!</p>
    <div id="form_btn01"><a href="<?php echo get_option('home'); ?>/?page_id=48">????????</a></div>
    <div id="form_btn02"><a href="<?php echo get_option('home'); ?>/?page_id=52">?????????</a></div>
    <div class="side_footer">&nbsp;</div>
    </div>
    <div id="mail_block">
    <h3>???????</h3>
    <p>?????????????????????????????!</p>
    <?php wpsb_opt_in(); ?>
    <div class="side_footer"></div>
    </div>
    <div id="english"><a href="<?php echo get_option('home'); ?>/?cat=34">English pages for US Employers</a></div>

    <div style="margin: 5px 0; text-align: center;">
    <a href="http://www.facebook.com/syukatsuusa" target="_blank">
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/fb_banner.png" alt="?????????????????????????????" border="0" />
    </a>
    </div>
    </div>

  • avatar
    Last edited:
    01/31/13
    9:10pm
    kensama0814 says:

    ??? is in Japanese language..

  • avatar
    Last edited:
    01/31/13
    9:14pm
    kensama0814 says:

    I tried replacing with this:
    <?php if ( is_category() || post_is_in_descendant_category(get_query_var('cat'))) { ?>

    but error still remains..

  • avatar
    Last edited:
    01/31/13
    9:15pm
    Arnav Joy says:

    you have two places there where you have called this function

    post_is_in_descendant_category()

    see other places where you have called this function with a no. passed to it as

    post_is_in_descendant_category(35)

    or

    post_is_in_descendant_category(36)

    so this 35 or 36 is id of the category , so you have to do same thing for the blank function

    post_is_in_descendant_category()

    for example

    post_is_in_descendant_category(33)etc..

    only then it will remove error

  • avatar
    Last edited:
    01/31/13
    9:19pm
    kensama0814 says:

    error now became the following:

    Warning: Missing argument 1 for post_is_in_descendant_category(), called in /home/content/98/7370698/html/us-internship/wp-content/themes/us-internship-new/sidebar.php on line 20 and defined in /home/content/98/7370698/html/us-internship/wp-includes/functions.php on line 3653

    it is now line 20 instead of line 36..

  • avatar
    Last edited:
    01/31/13
    9:22pm
    Arnav Joy says:

    this is because you have one more function call at line no. 20

    <?php } elseif ( is_category('information') || post_is_in_descendant_category()) { //?????>

    so you also have to place any no. (id of the category ) to the function as

    <?php } elseif ( is_category('information') || post_is_in_descendant_category(9999)) { //?????>

  • avatar
    Last edited:
    01/31/13
    9:51pm
    kensama0814 says:

    Thank you.
    I see oneplace without a no.

    I'm sorry but can you tell me how to find the right number to fill in?

  • avatar
    Last edited:
    01/31/13
    10:00pm
    kensama0814 says:

    I found out the number to fill in. and it looks it's working now!
    Thank you so much!

This question has expired.



John Cotton, Christianto, Dbranes, Naveen Chand, kensama0814 voted on this question.



Current status of this question: Completed



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.