Theme Author
Tom
(@edge22)
Hi there,
Which code did you add? An empty <div>
element? What is it doing?
Let me know 🙂
`>
Hi, that’s my Workaround to reproduce the Layout of a Clients Page:
content-page.php ->
…
?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?> <?php generate_article_schema( ‘CreativeWork’ ); ?>>
<!– Template Mod. formdesign.ch START –>
<div><img id=”maintop” class=”aligncenter size-full wp-image-75″ src=”https://site.ch/path/banner-01-wide.jpg” alt=”” width=”100%” /></div>
<!– Template Mod. formdesign.ch END –>
<div class=”inside-article”>
<?php
/**
* generate_before_content hook.
-
This reply was modified 5 years, 8 months ago by deBlogist.
Theme Author
Tom
(@edge22)
So what if instead of editing the theme file, you added this function to your child theme:
add_action( 'generate_before_content', 'tu_add_content_before_content' );
function tu_add_content_before_content() {
?>
Your custom content in here.
<?php
}
Let me know 🙂
Thanks to help me in the right direction.
I got it work using this:
function wpdev_before_after($content) {
if(is_page() ) {
$beforecontent = '<div><img id="maintop" class="aligncenter size-full wp-image-75" src="https://path/banner-01-wide.jpg" alt="" width="100%" /></div>';
$aftercontent = '';
$fullcontent = $beforecontent . $content . $aftercontent;
} else {
$fullcontent = $content;
}
return $fullcontent;
}
add_filter('the_content', 'wpdev_before_after');
Now I have to find how to put it above the Titel too (the Hook is “the_title”), but I think I could figure it out, thanks for your Help.
-
This reply was modified 5 years, 8 months ago by deBlogist.
-
This reply was modified 5 years, 8 months ago by deBlogist.
-
This reply was modified 5 years, 8 months ago by deBlogist.