← WordPress

Fuction.implode

Lida 2647 vezes

Offline

Tiago Neto 
Membro
Mensagens 261 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Level 5 Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2

Código: (php) [Seleccione]
Warning: implode() [function.implode]: Invalid arguments passed in /home/intense/public_html/portal/wp-content/themes/organic_magazine/header.php on line 70
Aqui o header.php

Código: (php) [Seleccione]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="en" />
<meta name="verify-v1" content="7XvBEj6Tw9dyXjHST/9sgRGxGymxFdHIZsM6Ob/xo5E=" />

<title><?php wp_title(''); ?><?php if(wp_title(''false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<link rel="Shortcut Icon" href="<?php echo bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php if ( is_singular() ) wp_enqueue_script'comment-reply' ); ?>
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/hoverIntent.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.flow.1.1.js" ></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/iepngfix_tilebg.js"></script>

<!--IE6 Fix-->
<style type="text/css">
    img, div, a, input, body, span {
        behavior: url(<?php bloginfo('template_url'); ?>/images/iepngfix.htc);
    }
</style>

<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(function() {
        $j("div#controller").jFlow({
            slides: "#slides",
            width: "960px",
            height: "350px",
            timer: <?php echo ot_option('slider_interval'); ?>,
            duration: 400
        });
    });
</script>

<script type="text/javascript">
     $j(document).ready(function() {
        $j('ul.ot-menu').superfish();
    });
</script>

</head>

<body>

<div id="wrap">

    <div id="header">
   
        <div class="headerleft">
            <p id="title"><a href="<?php echo get_option('home'); ?>/" title="Home"><?php bloginfo('name'); ?></a></p>
        </div>
       
        <div class="headerright">
            <div id="navtop">
                <ul class="ot-menu">
                    <?php $include_pages ot_option('include_pages'); ?>
                    <?php wp_list_pages('title_li=&sort_column=menu_order&include='.implode(print_r($include_categories), $include_pages)); ?>
                </ul>
            </div>
        </div>
   
    </div>
   
    <div id="navbar">
   
        <ul class="ot-menu">
            <li<?php if (is_home()) { echo " class=\"current_page_item\""; }?>><a href="<?php echo get_settings('home'); ?>"><?php _e("Home"'organicthemes'); ?></a></li>
            <?php $include_categories ot_option('include_categories'); ?>
            <?php wp_list_categories('depth=4&title_li=&sort_column=menu_order&include='.implode(','$include_categories)); ?>
        </ul>
     
            <div class="navbarright">
                <form id="searchformheader" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                <img src="<?php bloginfo('template_url'); ?>/images/search_icon.png" alt="Search" /><input type="text" value="Search Here" name="s" id="searchbox" onfocus="if (this.value == 'Search Here') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search Here';}" />
                <input type="hidden" id="searchbutton" value="GO" /></form>
            </div>
           
    </div>
   
    <div style="clear:both;"></div>


O erro ( primeiro codigo) faz com que o menu não fique direito, ou seja a categoria ficam fora da barra de menu. Podem me ajudar com o erro ?
Offline

STronic 
Elite
Mensagens 546 Gostos 8
Feedback +5

Troféus totais: 30
Trófeus: (Ver todos)
Mobile User Search Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3

Linha 80 - <li<?php


ups. já vi que o erro tá na 70.... nao deve ter a ver, mas podes corrigir.
Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Linha 80 - <li<?php


ups. já vi que o erro tá na 70.... nao deve ter a ver, mas podes corrigir.

Isso não é erro nenhum...

Quanto ao eu da linha 70, não sei, alguém que percebe bem de php que te diga.
Offline

STronic 
Elite
Mensagens 546 Gostos 8
Feedback +5

Troféus totais: 30
Trófeus: (Ver todos)
Mobile User Search Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3

Isso não é erro nenhum...


:D .. pois .. forget...
só olha para o inicio da linha.... fail...

quanto ao erro... o que te devolve um "echo $include_categories" ?
Offline

Tiago Neto 
Membro
Mensagens 261 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Level 5 Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2

Código: (php) [Seleccione]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="en" />
<meta name="verify-v1" content="7XvBEj6Tw9dyXjHST/9sgRGxGymxFdHIZsM6Ob/xo5E=" />

<title><?php wp_title(''); ?><?php if(wp_title(''false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<link rel="Shortcut Icon" href="<?php echo bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php if ( is_singular() ) wp_enqueue_script'comment-reply' ); ?>
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/hoverIntent.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.flow.1.1.js" ></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/iepngfix_tilebg.js"></script>

<!--IE6 Fix-->
<style type="text/css">
    img, div, a, input, body, span {
        behavior: url(<?php bloginfo('template_url'); ?>/images/iepngfix.htc);
    }
</style>

<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(function() {
        $j("div#controller").jFlow({
            slides: "#slides",
            width: "960px",
            height: "350px",
            timer: <?php echo ot_option('slider_interval'); ?>,
            duration: 400
        });
    });
</script>

<script type="text/javascript">
     $j(document).ready(function() {
        $j('ul.ot-menu').superfish();
    });
</script>

</head>

<body>

<div id="wrap">

    <div id="header">
   
        <div class="headerleft">
            <p id="title"><a href="<?php echo get_option('home'); ?>/" title="Home"><?php bloginfo('name'); ?></a></p>
        </div>
       
        <div class="headerright">
            <div id="navtop">
                <ul class="ot-menu">
                    <?php $include_pages ot_option('include_pages'); ?>
                    <?php wp_list_pages('title_li=&sort_column=menu_order&include='.implode(','$include_pages)); ?>
                </ul>
            </div>
        </div>
   
    </div>
   
    <div id="navbar">
   
        <ul class="ot-menu">
            <li<?php if (is_home()) { echo " class=\"current_page_item\""; }?>><a href="<?php echo get_settings('home'); ?>"><?php _e("Home"'organicthemes'); ?></a></li>
            <?php $include_categories ot_option('include_categories'); ?>
            <?php wp_list_categories('depth=4&title_li=&sort_column=menu_order&include='.implode(','$include_categories)); ?>
        </ul>
     
            <div class="navbarright">
                <form id="searchformheader" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                <img src="<?php bloginfo('template_url'); ?>/images/search_icon.png" alt="Search" /><input type="text" value="Search Here" name="s" id="searchbox" onfocus="if (this.value == 'Search Here') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search Here';}" />
                <input type="hidden" id="searchbutton" value="GO" /></form>
            </div>
           
    </div>
   
    <div style="clear:both;"></div>

Tinha modificado. Este é o original .
Offline

betanalista 
Membro
Mensagens 2564 Gostos 0
Feedback +18

Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

esta na função print_r estas a passar mal os argumentos

http://pt2.php.net/print_r
Offline

Tiago Neto 
Membro
Mensagens 261 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Level 5 Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2

Mas no original ( 2º post ) não tem essa função !
Offline

anjo2 
Membro
Mensagens 3020 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

Código: (php) [Seleccione]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="en" />
<meta name="verify-v1" content="7XvBEj6Tw9dyXjHST/9sgRGxGymxFdHIZsM6Ob/xo5E=" />

<title><?php wp_title(''); ?><?php if(wp_title(''false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<link rel="Shortcut Icon" href="<?php echo bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php if ( is_singular() ) wp_enqueue_script'comment-reply' ); ?>
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/hoverIntent.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.flow.1.1.js" ></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/iepngfix_tilebg.js"></script>

<!--IE6 Fix-->
<style type="text/css">
    img, div, a, input, body, span {
        behavior: url(<?php bloginfo('template_url'); ?>/images/iepngfix.htc);
    }
</style>

<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(function() {
        $j("div#controller").jFlow({
            slides: "#slides",
            width: "960px",
            height: "350px",
            timer: <?php echo ot_option('slider_interval'); ?>,
            duration: 400
        });
    });
</script>

<script type="text/javascript">
     $j(document).ready(function() {
        $j('ul.ot-menu').superfish();
    });
</script>

</head>

<body>

<div id="wrap">

    <div id="header">
   
        <div class="headerleft">
            <p id="title"><a href="<?php echo get_option('home'); ?>/" title="Home"><?php bloginfo('name'); ?></a></p>
        </div>
       
        <div class="headerright">
            <div id="navtop">
                <ul class="ot-menu">
                    <?php $include_pages ot_option('include_pages'); ?>
                    <?php print_r($include_pages); ?>
                    <?php wp_list_pages('title_li=&sort_column=menu_order&include='.implode(','$include_pages)); ?>
                </ul>
            </div>
        </div>
   
    </div>
   
    <div id="navbar">
   
        <ul class="ot-menu">
            <li<?php if (is_home()) { echo " class=\"current_page_item\""; }?>><a href="<?php echo get_settings('home'); ?>"><?php _e("Home"'organicthemes'); ?></a></li>
            <?php $include_categories ot_option('include_categories'); ?>
            <?php wp_list_categories('depth=4&title_li=&sort_column=menu_order&include='.implode(','$include_categories)); ?>
        </ul>
     
            <div class="navbarright">
                <form id="searchformheader" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                <img src="<?php bloginfo('template_url'); ?>/images/search_icon.png" alt="Search" /><input type="text" value="Search Here" name="s" id="searchbox" onfocus="if (this.value == 'Search Here') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search Here';}" />
                <input type="hidden" id="searchbutton" value="GO" /></form>
            </div>
           
    </div>
   
    <div style="clear:both;"></div>
Mostra o conteúdo do print_r
Offline

Júnio Branco 
Membro
Mensagens 563 Gostos 0
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Quase de certeza que a variavel $include_pages não é uma Array daí estar a apresentar esse erro. Mas faz o que te pediram que é apresentar o conteudo dessa mesma variavel.
Offline

Tiago Neto 
Membro
Mensagens 261 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Level 5 Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2

PHP não é o meu forte .

 Como se faz isso ? :/
Offline

STronic 
Elite
Mensagens 546 Gostos 8
Feedback +5

Troféus totais: 30
Trófeus: (Ver todos)
Mobile User Search Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3

mete no fim da página...
e há-de aparecer na página o conteúdo de "$include_pages" á frente da palavra "Resultado" ... copia e cola aqui.

Resultado: <?php echo $include_pages; ?>
Offline

Tiago Neto 
Membro
Mensagens 261 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Level 5 Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2

No header ?

Reparei agora nisto, branco com branco nãose vê xD , mas ao passar o rato apareceu isto.

Código: (php) [Seleccione]

    Home

    Warning: implode() [function.implode]: Invalid arguments passed in /home/intense/public_html/portal/wp-content/themes/organic_magazine/header.php on line 82