Hi
For instance here: https://wpbeansframework.com/ It shows the page title in the header. The tutorials page (blog) does not.
How would I show the blog title (page title) in the header? Here is some of the code that I am using.
// Set default image for blog.
if ( is_home() ) {
$image_url = '/wp-content/uploads/Green-mountains.jpg';
// Move blog title to header.
beans_modify_action_hook( 'beans_post_blog_title', 'beans_header_append_markup' );
}
Obviously the
beans_post_blog_title
is not a working hook.
If I use beans_post_title I will remove all the post titles of each post and take the first post title up into the header.
I found out that there is a beans_post_archive_title
that works for the custom post archives I have. This is not working for the default blog page.
What is the correct hook to affect only the blog title? Where can I find out more about these hooks? I have searched in the documentation I found only a mention of the beans_post_title.
Thanks!
There is something in the forum that shows how it can be done. im not sure the correct link. but thought its posttitle
just a heads up, on mobile everything appears "off" overlapping on each other don't forget to apply Responsive fixes.
Hey Paal,
i have the same problem. I use a index.php with custom post-loop. But i can´t place the page-title. Also the breadcrump seems completely removed for index.php ... why? Can i reactivate them?
Thanks.
beans_modify_action_callback( 'beans_loop_template', 'news_loop' );
function news_loop() {
?>
<div class="content-wrap uk-container-center">
<?php // START HEAD CONTENT ---------------------------------------------------------------------- ?>
<section class="content-section boxed head-section">
<div class="uk-container uk-container-center">
<header class="page-header">
<h1>???</h1>
</header>
</div>
</section>
<section class="content-section boxed <?php echo $device_visibility; ?> <?php echo $section_layout; ?>">
<div class="uk-container uk-container-center section-content">
<div class="innerwrap">
<div class="uk-grid" data-uk-grid-margin data-uk-grid-match>
<?php
if ( have_posts() && !is_404() ) : while ( have_posts() ) : the_post(); ?>
<?php
$read_more = get_field('option_excerpt_text', $general_options_page);
?>
<div class="the-post uk-width-medium-1-1 content_posts">
<div class="innerwrap postslayout">
<article class="last-post uk-grid">
<div class="uk-width-medium-2-5">
<header class="section-header">
<?php beans_post_image(); ?>
</header>
</div>
<div class="uk-width-medium-3-5 content-col">
<div class="article-content-wrap">
<?php the_date('', '<div class="post-date">', '</div>'); ?>
<h4 class="article-headline"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
<div class="article-content"><?php the_excerpt(); ?></div>
<a class="readmore" href="<?php the_permalink(); ?>" rel="bookmark" title="Zum Artikel"><?php echo $read_more; ?></a>
</div>
</div>
</article>
</div>
</div>
<?php endwhile; else : ?>
<div class="uk-alert">No Posts</div>
<?php endif; ?>
</div>
<?php beans_posts_pagination(); ?>
</div>
</div>
</section>
</div>
<?php } ?>
I have for the Blog-Title the followed solution:
<header class="page-header">
<?php
$page_id = get_queried_object_id();
$blog_page_title = get_the_title($page_id);
?>
<h1><?php echo $blog_page_title; ?></h1>
</header>