Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Building a custom theme from scratch

Discussion in 'Themes and Templates' started by Vendetta89, Jan 14, 2017.

  1. Vendetta89

    New Member

    Joined:
    Jan 14, 2017
    Messages:
    2
    Likes Received:
    0
    Hi there!

    I'm Jeremy and im 27 years young.

    What im trying to do is building a custom theme/layout from scratch. Since i'm new to this i have a few questions to ask u guys. codex wordpress site says alot but i don't understand everything (yet) so i hope u guys can help me out a little and give me a push in the right direction.

    When i started i made the following files:

    index.php, header.php. footer.php, style.css

    The following thing i want to do is add a Header slider/image to the header.php and with that the menu because i wanna keep te menu at the top even when scrolling down the page.
    In the index.php i want to display the header.php on top.

    Since i only can find how to display the blogs i'm asking myself how can i display the pages trough the menu in the header.php in the index.php. and offcourse when u click a menu link it has to display in the index.php

    I know i have to make a loop but the only loop i can find is the one looping the blogs but i don't want to use the blog setting. I want to make a webdesign that im going to use for further buissines purposes.

    I hope i'm a bit clear with what i want since my english isn't very well.
    I know this is basic stuff for u guys but for me it is still a bit hard to understand.

    Can u guys help me out with the right code?

    Thanks in advance and Kind Regards,

    Jeremy
     
    #1
  2. Paul Sean

    New Member

    Joined:
    Dec 12, 2016
    Messages:
    13
    Likes Received:
    0
    Hope this will help you to fix the menu part. Also please clear what you want to do with header and menu:
    1. Step 1 :

      Define a class in your stylesheet.

      eg .header-sticky

      .header-sticky{
      position:fixed;
      width: 100%;
      height: 108px;
      }

      Step 2 :

      On page Scroll add this code in your js file :-

      $(window).scroll(function(){
      var winWidth = $(window).width();
      if( winWidth > 767 ){
      if ($(".header").scrollTop() = 0 ){
      $(".header").addClass('header-sticky');
      }else{
      $(".header").addClass('header-sticky');
      }
      }
      });

      Step 3 :

      Call wp menu in this div :

      <div class="header">
      <?php wp_nav_menu($arg); ?>
      </div>
     
    #2
  3. Vendetta89

    New Member

    Joined:
    Jan 14, 2017
    Messages:
    2
    Likes Received:
    0
    #3
  4. Paul Sean

    New Member

    Joined:
    Dec 12, 2016
    Messages:
    13
    Likes Received:
    0
    #4
  5. srinivas katam

    New Member

    Joined:
    Feb 5, 2017
    Messages:
    4
    Likes Received:
    0
    #5
  6. YasarAli

    New Member

    Joined:
    Feb 5, 2017
    Messages:
    2
    Likes Received:
    0
    #6
  7. srinivas katam

    New Member

    Joined:
    Feb 5, 2017
    Messages:
    4
    Likes Received:
    0
    #7

Share This Page

Web Hosting