Ask your WordPress questions! Pay money and get answers fast! (more info)

Trying to insert an image via css in complicated WP theme WordPress

  • REFUNDED

Hi!

I have 2 small issues with my website, and despite my rather good knowledge of css and WP, I can't seem to figure them out. I need some help!

Here's the site : [[LINK href="http://www.mariecharlottepeze.com/"]]http://www.mariecharlottepeze.com/[[/LINK]]

1. On the index page, over the background photo, I'm trying to add a transparent png with text that would follow the same position as the menu on the left. I positioned that menu at 60% height. For some reason, I can't for the life of me figure out where to put that darn snippet of code. When I put it in the loops and templates, it doesn't appear at the right position on the page, it just goes up and left by default.

Also, it of course starts appearing on every page instead of just the index, moving all my stuff around. It would be fine if the page content hid it, but preferably I would only have that image on the index page anyway.

2. In "writing portfolio", I can't get rid of the "Editorial Portfolio" title. I have no idea where that's coming from !? I would also love to be able to show the description of the category in order to add a link to the more extensive portfolio but that's no big deal if it's too much to ask!

Many thanks for your kind help.

Answers (2)

2012-11-07

Arnav Joy answers:

for the first work you can use is_home() at header.php file before closing head tag to place you css as

<?php if(is_home()) { ?>

<style>
/*place your style for the home page here*/
</style>
<?php } ?>

and for the second point , it is title of your page , which can be found at page.php


Marie-Charlotte Pezé comments:

Hi! Thanks Arnav, I will try this.

For the second point, it's not the title of a page. This is actually the archive of a category, I should have mentioned that, sorry. The category is called Writing Portfolio, and it does not have a parent. I have no idea where that "editorial portfolio" is coming from - even though that is the title of one of my pages, yes. But it's not related, I don't understand what it's doing there.


Arnav Joy comments:

for the first point try this

<?php if(is_home() || is_front_page()) { ?>

<style>
/*place your style for the home page here*/
</style>
<?php } ?>


Marie-Charlotte Pezé comments:

Okay in fact I used

<?php if(is_front_page() ) { ?>
<div id="custom-menu">&nbsp;</div>
<?php } ?>

and put the css in style.css

Thanks for sending me in the right direction.


Arnav Joy comments:

for the second problem , i have to see your site , so can you provide me access to your site , send me pm


Marie-Charlotte Pezé comments:

Hi Arnav,

I've got someone else (not from here) working on it. If I don't get a solution today, I'll send you a message.

Thank you again :)

2012-11-07

Marko Nikolic answers:

Hello,

Do you have custom page template for index page? If so, put the code there, and then make it be absolute positioned via css. If you need code example for that, let me know.

If you don't use custom Page template for index page, you can use PHP if statement, and to place that code for example in header.php and then again to give it absolute position.

I'd suggest you to read [[LINK href="http://www.travisberry.com/2010/01/use-wordpress-is_page-to-display-custom-content/"]]this post[[/LINK]] and of course, to consult [[LINK href="http://codex.wordpress.org/Conditional_Tags"]]WP codex [[/LINK]], but if you need custom code written only for your case, let me know, and I will do it for you.


Second problem: you should check if that's the title of the page, but also it could be placed somewhere in theme options (I am not sure, but can be the case).



Cheers


Marie-Charlotte Pezé comments:

Thanks a lot Marko;

There is a custom template for the index page, but it doesn't seem to actually be functional in this theme. It only says "<?php get_header(); ?>" - and nothing else. I'm assuming that the index page is using the regular page template.

The problem I think is that the theme is quite complex. Pages have several layers; that background photo which shows up on the index page, but then the content which overlays with this sliding thingie; check it out here : http://www.mariecharlottepeze.com/editorial/art/red-thistle/

I wonder if that's why my css positioning isn't working. I don't know enough about php and WP loops to understand everything in the theme. I will try your suggestion and if nothing works I'll ask you for some custom code.

As for the title problem, like I told Arnav above, this is not a page, it's a category archive. The "writing portfolio" category does not have a parent. I don't know where that editorial portfolio thing is coming from, it's nowhere in the templates or options. It is however the name of a page, but it's a completely unrelated page. I have a feeling it's a bug.

Thanks for your help :)


Marie-Charlotte Pezé comments:

Hi Marko, in the end I used :

<?php if(is_front_page() ) { ?>
<div id="custom-menu">&nbsp;</div>
<?php } ?>

and put the css in the stylesheet. Thanks for sending me in the right direction.

Can't find a solution to my other problems though. I'll keep digging.

Thank you :)