Hallo scotti und vielen Dank schonmal für deine Antwort.
Ich habe die von mir erwähnte Abfrage nun auch mal in die Dateien "page.php" und "site.php" eingefügt, dennoch wird es auf anderen Seiten nicht angezeigt.
Somit wird der Fehler wahrscheinlich an der Abfrage in der functions.php liegen, wobei mir nicht wirklich auffällt, was dort der Fehler sein kann.
PHP
/* footer titles */
$pages = i_get_sidebar_pages('', false);
if ( is_array($pages) ) {
$stylesheet .= "/* footer titles */\n";
foreach ( $pages as $p ) {
$img = headline_image_get($p->ID);
if ( $img[0] != '' ){
$stylesheet .= "body #bottom-{$p->post_name} {\n";
$stylesheet .= "\tbackground:url({$img[0]}) top left no-repeat;\n";
$stylesheet .= "\ttext-indent: -9000px;\n";
$stylesheet .= "\theight: 40px;\n";
$stylesheet .= "\tmargin-top: 0px;\n";
$stylesheet .= "}\n\n";
}
}
}
Alles anzeigen
PHP
if ( !function_exists('i_get_sidebar') ) {
function i_get_sidebar ()
{
global $i_sidebar;
if ( !$i_sidebar )
{
global $post;
$i_sidebar = $post->post_name;
}
return $i_sidebar;
}
}
Alles anzeigen
PHP
if ( !function_exists('i_get_sidebar_pages') ) {
function i_get_sidebar_pages($sidebar_name = '', $echo = true)
{
if ( !$sidebar_name )
$sidebar_name = i_get_sidebar();
$limit = 3;
$limit -= i_count_widgets($sidebar_name);
if ( $limit < 0 ) $limit = 0;
global $sidebar_page;
$query_params = array(
'orderby' => 'menu_order',
'order' => 'ASC',
'post_type' => 'page',
'numberposts' => $limit,
'meta' => array( array('meta_key' => 'sidebar_'.$sidebar_name), array('meta_key' => '_sidebar_all' ), array('meta_key' => $sidebar_page) )
);
/* specific page bottombar */
global $post;
if ( $post->post_type == 'page' ) {
$query_params['meta'][] = array('meta_key' => '_sidebar_'.$post->ID);
}
$i = 0;
if ( $echo ) {
$pages = new My_Query($query_params);
if ( $pages->have_posts() ) {
while ( $pages->have_posts() ) {
$pages->the_post();
$i++;
$read_more = get_post_meta(get_the_ID(), 'read_more', true);
?>
<div class="column">
<h2 id="bottom-<?php the_post_name(); ?>"><?php the_title(); ?></h2>
<?php the_content(''); ?>
<?php if ( $read_more !== "0" ):?><a href="<?php the_permalink(); ?>" class="button green">Read more</a><?php endif; ?>
</div>
<?php
}
}
}
else {
$pages = new My_Query($query_params);
$pages = $pages->posts;
}
return $pages;
}
}
Alles anzeigen
Vielleicht erkennst du, bzw. erkennt ihr, den Fehler.