Forum Replies Created

Viewing 15 replies - 1 through 15 (of 62 total)
  • billynair

    (@billynair)

    (before continuing, go to https://jsfiddle.net/ or https://codepen.io/ and get your code uploaded. It is fine not to put the entire site up, just the part you need help with) I can not promise I will be able to help, since I am really only here trying to get someone else to help with one of my problems and doing this in the down time, but it will make things easier for other people to come and help too

    hooey!! OK, feels like I am back grading assignments again. There are quite a number of errors and redundant code in your CSS (which leads to weird results and also makes it confusing to debug for you and anyone maintaining it later), but for me to see what is actually wrong with your header we would have to see the HTML code, at least starting from <body> to a few elements past your </nav> or </header>, to see if something else is messing with them after words (sometimes a clearfix, if you use one, is missing)

    Here is some observations with your CSS for now:
    I will be using line numbers for this, so copy from the top of the code to the end, the
    /*
    Site Header

    down to the last }, there should be 699 lines.

    line7, you have margin-left: 20px auto;, but it should only have one value, but this is erased in line8 with margin: 1rem auto;

    line8 margin: 1rem auto; – not wrong, but usually margin:0 auto;

    line18 padding: 16px 0; canceled by line19 padding: 1.6rem 0;, which is then canceled in line32 padding: 0;

    There are a ton of redundant lines that immediately kill a preceding line like in lines38 – 42:
    font-size: 50px;
    font-size: 5rem;
    font-weight: 300;
    letter-spacing: 4px;
    letter-spacing: .4rem;

    Since you already know how to use em/rem, I would remove all the redundant lines with px in them (about half the code referring to text you have redundant code in it. If you are worried about browsers understanding rem, you can just use em, which you would want to use most of the time anyway, that way the spacing is relative to the text size in the element you are spacing so when you change the size of the text, your padding/margins will be proportionate without you needing to change those too)
    I am sure there are a number of these redundant lines in separate classes, and those might be superseding other lines you are trying to tweak. If you are trying to adjust something and the element is not responding, you might try placing that code at the end of your CSS and see if it works then. That would mean there is some other code that is resetting your element elsewhere, but for now, go through and at least find the ones that are right next to each other like lines478 and 479
    padding: 15px 5%;
    padding: 0rem 5%;

    This will help you see what is manipulating which element easier.

    line431 display: block !important! does not have a semi-colon, and should read display: block !important; (and since you are using !important, I am guessing it is being canceled by another line of code somewhere. This is where finding redundant code will help you out.)

    there is an extra ; in line131

    I do not see the end } for the media query starting in line547, check to make sure it is in the CSS.

    billynair

    (@billynair)

    (This last entry was a duplicate, but I dont see where to delete it)

    billynair

    (@billynair)

    I was thinking about this on the way home today, and I am not sure how your slides are set up, but maybe you can pull the HTML part out of both the if and the else and just run through the check code and assign a variable to hold which slides will be shown, then when you drop out of the while, that variable/array holding the slide IDs will then be fed into the HTML part to display the slides. Something like this (psudo code):

    Loop finding which IDs you need{
      $MyArray[x] = IDs
    } (end while)
    
    Loop to display the slides{
      <li><img href="$MyArray[x]" /></li>
    }

    Would something like that work?

    billynair

    (@billynair)

    OK, I saw that it needs to add more than one slide, yeah, my answer will not work for that. I am an insomniac and can’t sleep right now, but I am to tired to concentrate on anything, hahhaha!! oh well, I deleted my reply, but I am guessing you will be getting some answers soon

    billynair

    (@billynair)

    Man, I think I found it! go look at the answer…

    billynair

    (@billynair)

    Sorry man, I am trying to run this code in my head, but I am fried for the day, Thanks for linking me to that post, but I can’t do this in my head right now. If I had the whole thing I might be able to figure it out. ANYWAY, I found a few things that might help clean things up, I doubt they will make things work, but it might make things easier to follow for other people:

    You have

    HTML to display slides
    }
    }
    ?>
    <?php $i++; endwhile; ?>

    but there is no reason to separate the PHP there (and it breaks the association with the while in text editors)

    Unless you are using $i somewhere else in the website, it doesn’t need to be there to loop the while, ($query->have_posts()) already does that.

    This is the line that I wanted to test in your program:
    $AssignedPages = get_field(‘assigned_pages’, false, false);
    You have it listed twice which, just looking at this cold, doesn’t look like they are both needed.
    It is also followed by another if inside of the else, I am guessing 2 is the index of the default image, which will always be in the $AssignedPages array right? It will always be true, so no need for this if. I can’t help but think that this nested if inside the else is causing problems, if not in the code then at least in trying to chase down the problem. I am not positive, but I am guessing you can just erase everything inside of the else and leave only the HTML to display slides.

    Like I said, I tried to run this through my head right now, and although it is a really simple piece of code, I can’t do it in my current state…

    billynair

    (@billynair)

    I am not sure how you are producing this text, but could you insert your posts using a PHP include? then you just make a PHP file with that text that you could change how ever you needed to

    Thread Starter billynair

    (@billynair)

    I tried logging in from a friend’s computer thinking that maybe there was something wrong with my system or firewall but I had the same exact problems, and she logged in right after me no problem.

    Is there a way to trace what my site is doing after I hit enter? (find out what protocols it is running, what pages it is accessing, etc?)

    billynair

    (@billynair)

    Relative positions go off of the parent element (ie the <DIV> or <NAV>) and that is fine and dandy, but you also have to take into account some other factors that would effect the parent which would then effect the objects you are positioning (width of the screen, display property of the parent, inline/block elements, etc). Absolute position is independent of the parent, but not very flexible, but then again relative is not usually good for responsive sites (big and small screens)

    Are the DIVs, NAVs, SPANs, etc nested the way you are expecting? (I spent the past 3 hours trying to get my friend’s navbar located in the right spot and after a while I finally found that her HEADER tag was nested INSIDE of the NAV, which is fine, but that is NOT normal practice and that is why I was so frekn confused for so long. After I got the header and nav nested the way normal people nest them, it took me 28 seconds to fix the positioning.)

    You can code it anyway you would like, but I have moved away from the absolute/relative positioning for the kind of menu style you are going for. I would suggest using a parent div to wrap the 3 elements and float them, and give them a width of something like 40%/20%/40% (depending on their sizes of course) then use a margin:0 auto; on the parent to center them all.

    Floating the elements and allowing them to bump around and expand and contract dynamically is really the best practice for modern sites, but if you are wanting help with this relative question you might need to post some code. You said you had it working until you changed something, we will not be able to guess what that something was, there are so many factors in building websites that it could be almost anything.

    billynair

    (@billynair)

    DO you have the default image load automatically and then swap it out when a page that has a picture is displayed? This way the image will swap out and you do not get duplicate images, but if there is no image to swap out, the image will just stay.

    We also might need to see the code, even though you explained things pretty well, we don’t know what the code is doing in the loop to see why the if/else should be inside rather than outside of the code, or how to explain if we knew what was wrong.

    One thing to think about is this is a WordPress forum, and although you might have a few people here that know how to code pretty well, you are going to find people FIGHTING over your question at StackOverflow. They are the nerdy of the nerds and that site is built on the points system. I wish I had a question like yours over there, I could rack some points…

    billynair

    (@billynair)

    billynair

    (@billynair)

    ah, actually that is a good question. I have often wondered how they got those, sometimes it is the biggest picture on the page and sometimes it is just random. I would actually like to know this too!

    In fact, I wanted to find out bad enough to use the googles and found this: https://www.insivia.com/so-how-do-i-change-that-facebook-thumbnail-image/

    I haven’t tried it, and you might want to use a PNG rather than a GIF, but try it and let us know what happens.

    billynair

    (@billynair)

    Are you talking about your Gravitar? Are the profile places other websites that you have signed up for like say youtube?

    There are a number of sites that will use your email address to identify you and if you have used a picture on another site using the same email address they might grab that picture. The image you see to the left here of me is hosted at Gravitar and I can change it there, and even use a few different ones for specific websites. If you have a gmail/google account, a lot more sites will use that image. It is kind of creepy that they can do it, but that is the world we live in now…

    Forum: Fixing WordPress
    In reply to: Menus not working
    billynair

    (@billynair)

    is it a javascript menu? CSS? who made it, where did you get it? Did you code it or tweak it?

    billynair

    (@billynair)

    Here is a quick, basic “centering things” tutorial.

    Something a little more intense about how objects interact with each other using “floats“.

    This is the one that I used to learn about DIVs and using relative and absolute positioning.

Viewing 15 replies - 1 through 15 (of 62 total)