I am starting to dive into some PHP on my wordpress and I'm having some trouble
What I am trying to do:
1. add a button to the bottom of each image in an image gallery there are 4 rows and 4 columns
What I have done:
I created a child theme and copied my page.php file to my child them
added a div like this to my my php file: <div class="button"></div>
added the following CSS to my style.css
.page-id-482 div.button{
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 15px;
}
I am stuck as to what I need to do to add a button to each image in the gallery. Every time I change the CSS I cant get the button to move. It currently sits where I placed it in the PHP. I need to change my CSS but I'm not sure how.
See image:
Related
My website is www.rosstheexplorer.com.
I am using the Penscratch theme although have modified many aspects of it.
I recently made a number of changes including making my header and navigation bar full width.
One of the unintended consequences of these changes is now my widget-area is no longer sitting side by side with my content-area.
I used the Developer Tools on Google Chrome and started trying to alter the width, padding and margin of both elements. Nothing I tried resulted in anything close to what I wanted. I would do more experimentation but I have very little idea as to where to begin.
In style.css do I have to made a modification to
.site-content .widget-area {
margin-top: 27px;
padding-top: 24px;
border-top: 3px solid #eee;
}
or
.widget {
line-height: 2.09231em;
position: relative;
overflow: hidden;
width: 100%;
margin: 0 0 27px;
padding: 0 0 27px;
border-bottom: 1px solid #eee;
See if this code works for you:
#primary.content-area {float: left;width: 70%;}
#primary.content-area .site-main{width:100%;}
.widget-area{float:right;width:30%;}
Inspecting your site, what i understand is, it is an issue related to float.
try applying
float:left
for your ".widget-area"
My website is www.rosstheexplorer.com.
I am using the Penscratch theme although have modified many aspects of it.
I recently made a number of changes including making my header and navigation bar full width.
One of the unintended consequences of these changes is now there is a lot of space between the navigation menu and primary and secondary areas.
I used the Developer Tools on Google Chrome and started trying to alter the width, padding and margin of a variety of elements on the page.
The below code was the closest I got to solving the problem. The below only works though if the browser window is certain dimensions. If the browser window is to small then the below code forces the content-area and widget-area to overlap the navigation menu and header.
Is there a way I can modify the below code so it works regardless of the browser window size.
.widget-area {
float: right;
width: 30%;
margin-top: -350px;
}
#primary.content-area {
float: left;
width: 70%;
margin-top: -350px;
}
Or is there another completely different solution?
Change the below css
style.css:1932 #screen and (min-width: 75em)
.site {
max-width: 1153px;
margin: 400px auto; // change this to margin: 5px auto;
padding: 54px 108px;
}
:43 #screen and (min-width: 75em)
.site {
max-width: 1153px;
margin-top: -50px auto; //remove this minus is not recommended
padding: 54px 108px; // change this to padding: 0px 108px 54px 108px;
}
kindly change the above margin and padding
It's much simpler than that:
http://www.rosstheexplorer.com/?custom-css=cedea99283
Line 45: margin-top only accepts 1 property, you specified 2 (50px auto). Just remove the "auto"
So i'm making this site which is based on wordpress for adding dynamic content but i have set up an entirely HTML/CSS and little jQuery built theme.
The issue i'm facing is when I had to place the front page posts like teasers with a link to the entire post
teaser like this :- http://i.gyazo.com/dda9c60eb3a822b84bdcb3e0067dfc3e.png
as i knew nothing about wordpress themes, i took help of esclate's php files and just made up a code that could harbour my css classes,id's and properties with it.
Hence to start with, the post's elements in header.php was setup like this :-
<div class="post-wrapper">
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<div id="content">
that was the same for the single.php file,
i successfully made the site have teaser posts for the front page but the issue arrived when the same properties of those above ID's got called to the single.php file as the classes and id's were similar, which is shown/open when the user clicks on full article,
i made another class for the single.php post elements but it had no effects.
here is what it looked like :- http://i.gyazo.com/0ec25c1db676463dd6aea209480e9568.png
it shows a teaser and not the full post, how can i rectify this?
btw the css code for them all
#page {
width:100%;
margin: 0 auto;
padding: 0;
display: inline-block;
}
#page-bgtop {
}
#page-bgbtm {
margin: 0px;
padding: 40px 50px 0px 50px;
}
#content {
float: left;
width: 100%;
padding: 0px 0px 0px 0px;
margin-left: -40px;
padding: 20px;
display: inline-block;
margin-bottom: 40px;
font-family: 'Raleway',Arial,sans-serif;
font-size: 14px;
line-height: 23px;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
}
I hope i have discreetly explained everything in my grasp for this issue.
As you are dealing with id's the same will be applied where-ever the id's are used, it overrides classes by default. You can create new id's or add class="" in your html so in your css you can mark elements !important to override the id content. This gets messy though so you would be better to change your ids to classes in the above example and use id's to make small changes to the class in the different pages.
I have a little problem. At the end of my R script I create an image .png as output. I wanna show this image on my website but sometimes it is drawn, sometimes it is not drawn. I don't understand how it is possible. I`ll put my code:
I insert the image in a div with this features:
#diagramm {
position: relative;
border: 2px solid #333;
border-color: #6495ED;
width: 820px;
height: 370px;
margin: 2px auto;
margin-top: 2em;
background-image: url("/home/daniele/public_html/appweb2013/venn_final/fungo_final.png");
}
Where is the mistake? Can I use a better method?
This is CSS, it only puts specific design rules for an element that has the id diagramm.
So what you've posted is not code so to speak.
In what way do you generate the output? When? what does the user do to generate it etc.
Do you have any javascript or html code you can show?
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I need help from wordpress experts on editing or creating themes. I have been trying to imitate the lol.garena.ph and so far what I've done was the nav button,here are the codes:
<style type="text/css">
body{
background-color:#000
}
Hh.hoverHome {
position: relative;
top: -3px;
padding-bottom: 7px;
background:url(homeHover.png); /* this will raise the element */
}
Hn.hoverNews {
position: relative;
top: -3px;
padding-bottom: 7px;
background:url(newsHover.png);
}
Hg.hoverGuides {
position: relative;
top: -3px;
padding-bottom: 7px;
background:url(guidesHover.png);
}
Hh {
list-style: none;
height: 22px;
width: 79px;
float: left;
display: block;
padding: 5px 10px;
margin-right: 10px;
background:url(home.png);
}
Hn {
list-style: none;
height: 22px;
width: 79px;
float: left;
display: block;
padding: 5px 10px;
margin-right: 10px;
background:url(news.png);
}
Hg {
list-style: none;
height: 22px;
width: 79px;
float: left;
display: block;
padding: 5px 10px;
margin-right: 10px;
background:url(guides.png);
}
</style>
</head>
<body>
<div class="container">
</div>
<Hh onmouseover="this.className='hoverHome';" onmouseout="this.className='';"> </Hh>
<Hn onmouseover="this.className='hoverNews';" onmouseout="this.className='';"></Hn>
<Hg onmouseover="this.className='hoverGuides';" onmouseout="this.className='';"></Hg>
</body>
</html>
The problem I'm having is I don't know where to put this on wordpress theme because all I see are php files. I tried to insert the css part on the style.css on twentyeleven theme and the rest of the parts on the content.php but it still does not work. I'm still new to Wordpress so please help me out, thank you.3
I am not really sure of your question with regards to what you are trying to achieve, however if you want to work with an existing theme to base your new theme on, I would advise using WordPress Child Themes.
http://codex.wordpress.org/Child_Themes
With child themes you can create a new child style.css file to make all your changes for CSS. The benefit of using a child theme is that you can quickly make changes to the existing CSS and PHP files without changing any of the core files.
This is very beneficial in the long run as it means that you are able to update your WordPress themes without any of your existing CSS and PHP changes being overwritten.
I hope this helps you with your quest to create a WordPress theme. I would advise looking at the WordPress tutorials on Treehouse (teamtreehouse.com) if you have an account or you can go to YouTube to find other great tutorials that might help.