Tagged: Blog, custom, header image, page.php, php
-
AuthorPosts
-
January 6, 2016 at 8:26 pm #560738
I’d like to add an image to the top of my blog page. I’ve added it to my archive and single post pages (http://www.abidinghope.org/2014/10/), but I can’t manage to get it to show on the blog page (http://www.abidinghope.org/watch/sermons-test/). I’ve tried adding an is_page if statement to page.php but it doesn’t have any effect.
Here’s the code I’ve added to page.php – I put it underneath <div class=’container’>:
<?php if(is_page( '12929' )) {?> <img src="http://www.abidinghope.org/uploaded-files/images/watch/watchImages_sermons.jpg"> <?php } ?>
It’s been a while since I’ve written PHP, so I’m not sure if it’s the code or something else.
Any help is appreciated!
January 6, 2016 at 9:16 pm #560758Hey jwyderko!
Try convert your code to
<?php if(is_page( 'sermons-test' )) {?> <img src="http://www.abidinghope.org/uploaded-files/images/watch/watchImages_sermons.jpg"> <?php } ?>
and let us know if that works out good for you
Best regards,
BasilisJanuary 6, 2016 at 10:33 pm #560791Hi Basilis,
Thanks for your response. I tried changing the code to the page slug but it had no effect.
Any other ideas?
January 7, 2016 at 11:04 pm #561582Hi!
can you provide us admin access, so we can take a deeper look please? post login details here as private reply.
Best regards,
AndyJanuary 8, 2016 at 5:48 pm #562126See the private reply
January 10, 2016 at 4:24 pm #562731Hey!
Thanks for the info I did not see you have set any background image. Please goto Enfold Options > General Styling > Logo Area > background Image and select a predefined image or you can upload a custom background image.
Cheers!
VinayJanuary 11, 2016 at 5:56 pm #563392Thank you for your response, but I don’t understand how that will solve my problem. I’m trying to get a custom image at the top of just my Blog Page (http://www.abidinghope.org/watch/sermons-test/). You can look at my archive pages for an example of the image/layout I’m looking for on my Blog Page (http://www.abidinghope.org/2016/01/).
See my earlier message in the thread for the code that I’ve tried adding to my page.php file.
January 11, 2016 at 11:54 pm #563567Hi!
Do you have a mockup to share with us? so we can help you better. You may upload it to image hosting service like imgur.com and apste the direct link here.
Regards,
VinayJanuary 11, 2016 at 11:57 pm #563568As I said in my previous post, I want the Blog Page to look like my Archive Pages which you can see at http://www.abidinghope.org/2016/01/. Is that not a satisfactory example?
January 12, 2016 at 1:29 pm #563861Hi!
you can change archive page layout by following these steps: http://kriesi.at/documentation/enfold/change-archive-categorytag-blog-style/
Cheers!
AndyJanuary 12, 2016 at 5:45 pm #564069Ok. I REALLY do appreciate your assistance, but this is getting ridiculous. This is the third message in a row that I have received that is erroneous or has nothing to do with my problem.
Assuming that it’s me who is not being clear enough, here’s an image that shows exactly what I want to happen: http://www.abidinghope.org/uploaded-files/screenshot.png.
Please let me know if there’s anything I can do to clarify what I’m trying to do.
Thank you.January 12, 2016 at 5:59 pm #564081Hi!
You can go to Enfold theme options > Blog Layout > Blog Layout and choose to use Advanced Layout Builder to create your blog page and edit it as any other page and add your image to the top of your content manually.
Best regards,
YigitJanuary 12, 2016 at 6:11 pm #564093Thanks you. I tried that, and it works for the Blog Page, but then the Archive and Tag pages don’t use the Grid Layout anymore (see what my Archive Page looks like now http://www.abidinghope.org/2015/12/).
Is there a way to force the Archive and Tag pages to use the Grid Layout while the Blog page uses the Advanced Layout Builder?
January 12, 2016 at 8:29 pm #564137Hey!
what about if you disable ALB on posts and then use the shortcode wand instead? Then you won’t have any layout conflicts I think.
Cheers!
AndyJanuary 13, 2016 at 10:43 pm #565051Thanks for the reply, but I worked it out a different way.
In case anyone comes across this with the same problem, here’s what I did: after scouring the code using Firebug, I discovered that the PHP file used for the Blog Page isn’t page.php, it’s index.php. I put my original code (see the top of this thread) underneath <div class=’container template-blog ‘> in index.php and it works great. No if-statement needed. -
AuthorPosts
- The topic ‘Add Header Image to Blog Page’ is closed to new replies.