Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show 4 item each row #1

Open
tayfunyasar opened this issue Oct 27, 2015 · 2 comments
Open

Show 4 item each row #1

tayfunyasar opened this issue Oct 27, 2015 · 2 comments

Comments

@tayfunyasar
Copy link

I'm not good at css, so cant handle this.

How can i show 4 item for each row? and Can you do this modular? Can i set it in customize.php?

Can you help me?

@tayfunyasar
Copy link
Author

I've put this into footer. There was no choice. Because style.css always override me.

<style type="text/css">
@media screen and (min-width: 64em) {
  .permalink, .permalink:nth-child(n+2) {    
    float: left;    
    width: 20%;    
    margin: 3px 5.5% 60px 3px;
  }
  .permalink:nth-child(n+1) {    
    clear: none;
  }
  .permalink:nth-child(4n+4) {    
    margin-right: 0;
  }
  .permalink:nth-child(4n+1) {    
    clear: left;
  }
}
.perma-title {
    line-height: 2em;
}
#thesidebar {
    text-align: left;
}
.fancyme-alphabet #tabnav {
    margin-left: -3px !important;
} 
</script>

does it look good?

@tellthemachines
Copy link
Owner

Hi tayfunyasar,

First off, the best way to customise a WP theme is by creating a child theme (see how to do that here: https://codex.wordpress.org/Child_Themes). Then in your child theme's style.css you can add the styles to override mine.
As regards the code, you'll be wanting to target (2n+1) with the clear:none, to override the 2-column default for the smaller breakpoint, but you'll also want to target (3n+1) to override my desktop styles. The rest seems OK to me. I haven't tested it, mind.
(if you want to know more about how the nth-child selector works, there's a really good post here: https://css-tricks.com/how-nth-child-works/)
You might also want to juggle the values of width vs margin on the .permalink element to get the spacing just right.

Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants