acellar
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Themes and Templates
In reply to: [Customizr] Single Page – Show picture before title…Forget this post… i’m using a slider now.
CheersForum: Themes and Templates
In reply to: [Customizr] Single Page – Show picture before title…I think i found now a way according to the article:https://presscustomizr.com/snippet/add-a-specific-page-or-post-content-in-another-post-or-page/
function display_content_before(){ if (!is_page ( '%PAGE-TITLE%')) return; ?> <div id="tc-reset-margin-top" class="container-fluid" style="margin-top: 138px;"> </div> <div class="row-fluid tc-single-post-thumbnail-wrapper __before_main_wrapper"> <section class="tc_thumbnail span12"> <div class=""> <a class="tc-rectangular-thumb"> <img class="attachment-slider-full tc-thumb-type-thumb wp-post-image wp-post-image tc-smart-loaded h-centered" src="%PICTURE-URL&" alt="" style="display: inline; height: 300px; opacity: 1;"> </a> </div> </section> </div> </div> <?php } add_action ( '__before_main_wrapper', 'display_content_before', 0 );
But the image is not responsive on mobiles and when i click on the menu on my mobile the header is than beneath my picture which i have defined…
You can see it here –> https://cellarbeans.ch/eine-seite/wo-wir-schon-waren/Thank you for your help.
Cheers Adrian
Forum: Themes and Templates
In reply to: [Customizr] Single Page – Show picture before title…Thank you very much! That is perfect, i had to change it slightly to work for me…otherwise the picture comes up on every page / post….
add_action('__before_main_container', 'add_image', 5); function add_image(){ if(is_page ( 'PAGETITLE')) { echo '<img src="your/img/url/here" />'; } else{ echo ''; } }
The picture is not strechted (witdh) to the full size of the page, how i can do that?
Do i have to insert some html code into the function?
Thank you!Cheers Adrian
Viewing 3 replies - 1 through 3 (of 3 total)