Forum Replies Created

Viewing 15 replies - 61 through 75 (of 97 total)
  • There’s others : get_the_post_thumbnail(), get_image(), …. but dunno if they works with pages and outside the loop. Can’t check at the moment because codex.www.ads-software.com seems off. Might be until the team see the trouble Monday I guess…

    Another way would be using custom fields in the admin new page form, where you enter the url and then call it in php with

    <?php
    $image_url = get_post_meta($post->ID, "NameOfYourCustomField", true);
    if ( !empty($image_url ) ) : ?>
         <img src="<?= $image_url ?>" alt="thumbnail" style="float: left;" />
    <? endif; ?>

    But I think it doesn’t answer you question as it doesn’t use the thumbnail size specified in the media preferences.

    You’re welcome !
    Have a happy coding ??

    You may want to backup your files because I’m gonna give you many changes to do. This way if it doesn’t suits you, you will be able to restore from this version.

    Ok let’s go.
    Just under the <ul> of your nav bar, you’ve got an extra </div>, remove it.

    In this css you linked https://pastebin.com/dzd6YDY3, remove the background : white; for div elements. If blocks overlap, you won’t see the ones underneath. Maybe you would prefer background: transparent;
    Remove margin: auto; also.
    Well, let’s keep it simple, I suggest you erase all this code :

    div {
        background: white;
        width: 65%;
        margin: auto;
    }

    Then remove position: absolute for div#post and div#sidebar, in your style.css, around line 72 and 132. Clean also any left, right, top, bottom you find for #post and #sidebar, they’re useless without position: absolute. Remove margin-left: 0; too (for your #post, still line 132 of style.css).

    Remove margin: 20px; for your ul#list-nav.

    What do you think about that? It’ better now, no? The last big thing you have to do, is make the sidebar floating on the right of the content.

    But let’s make it step by step. Begin with this and come back show me the result. The end is near ??

    Sorry I made a mistake (should not answer so late in the night :P).
    What I explained before about the box model is still true, though.

    In fact in margin: 0 auto; the first part is TOP & BOTTOM and the second part is for LEFT & RIGHT (auto will center the element with his parent if his display is of type block and his width is smaller than his parent element). So it doesn’t apply to your <ul> because is display is inline, ha-ha.

    Therefore in your case auto is useless, a margin: 0; is enough.

    Yeah, like I said, you have to fix your markup first. See this : https://validator.w3.org/check?uri=http%3A%2F%2Fprosalamander.com%2Fdev%2F&charset=utf-8&doctype=XHTML+1.0+Transitional&ss=1&outline=1&group=0&No200=1&verbose=1&st=1&user-agent=W3C_Validator%2F1.2
    Focus on the firsts errors, they are very important : There’s a <body> start-tag missing, and then `<a name=”top”></a>
    <div id=”wrapper”>` is appearing twice, so keep the first, and get rid of the second occurence.

    At this point everything will become more clear. You’ll see your complete navigation bar.
    Then it’s all about positionning. Remove the <center> tags around your nav (it’s deprecated, you’d prefer using CSS). Ok so now the nav bar should be right under the logo and left-aligned with it.
    But post and sidebar are still strange .In fact, this theme seems to mostly rely on position: relative and position: absolute. I’d suggest putting #post and #sidebar in the same div, removing their position: absolute and using float:right on the sidebar and margin-right on the post instead.
    But yeah that’s a lot of work as there’s many things to fix to my mind but maybe you don’t wanna take so much time…

    So begin with the markup fix and come back here, we’ll see what we can do.

    That’s because every browser, by default, dedicate some space for the list’s bullets or numbers.
    For IE -> it’s a margin-left : 40px;
    For others -> it’s a padding-left : 40px;

    But your theme has a css rule

    #topnav ul{
    	margin: 0px auto;
    }

    so you did reset the horizontal margin, but not the padding. And when you modify only one of these and not the other, you end up with this whole mess you met today, even without noticing it ^^

    So IE said : there’s no margin-left on this ul, so let’s align it at 0 on the left (because the padding is part of the box so I ignore it in the box placement process)
    The others said : there’s no margin, but there’s a padding-left, which I consider outside of the box, so let’s indent it from the left.

    Dunno if it makes more sense…

    Option 2 seems like the more times you load a library the more to would compound on performance because you are increasing the amount of code to be executed?

    No, because with opt’2 you want to make sure each plugin will load the lib relative to his own path and don’t even be aware of the lib/ folder in the other plugin’s file structure. That’s why you can easily re-use this plug on many projects. Easy to deploy !
    Assuming this file structure for example :

    |_wp-content/
    ….|_plugins/
    ……..|_mypluginNumberOne/
    …………|__myPluginNumberOne.php (entry-point of the plugin)
    …………|_libs/
    …………….|_myclass.class.php
    …………….|_foo.class.php
    …………….|_ …
    ……..|_myAwesomePlugPlug/
    …………|_myAwesomePlugPlug.php (entry-point of the plugin)
    …………|_libs/
    …………….|_myclass.class.php
    …………….|_somethingUseful.class.php
    …………….|_bar.class.php

    You’ll have something like this in both entry-points scripts
    <? require_once( dirname(__FILE__) . "/lib/myclass.class.php" ); ?>
    But each plugin will load HIS own copy of “myclass.class.php”, located in HIS own lib/ folder.
    So there won’t be any conflict or file which is loaded twice. The server will load only files requested by the script.

    Also I noticed I have to name each class differently because it can not load it multiple times or it generates and error…

    Yep, you can’t call two vars/functions/classes, etc. with the same name otherwise it will raise a conflict. Or you’ll have to use namespaces https://www.php.net/manual/en/language.namespaces.php
    But you can stick with avoiding duplicate names, it’s a lot easier ^^

    I tried Option 1 in my theme but it doesn’t seem to share over to a plugin and theme but generates an error because the plugin will not see the class but the theme will and vice versa?

    Don’t have enough clues to tell you why it did not work for you, but it should.

    Yep it’s a very known difference of interpretation in the “box” model between IE on one hand, and all other modern browsers on the other hand (recognized as more w3c compliant, unlike IE…). IE considers padding and border to be part of the width so you can’t really use padding and/or border along with width/height -> https://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug

    Quick Fix in your case :

    #topnav ul {
        padding: 0;
    }

    Going further : https://meyerweb.com/eric/tools/css/reset/ or inspect the beginning of the main twenty-ten theme css file.
    If one day you wonder how to do the opposite (indent on all browsers), try text-indent or margin instead of padding.

    You could try the javascript way. This example with jquery :

    First, in the header.php file of your theme, add this code the line before the closing head tag (</head>) :

    <!-- include the latest version of jQuery-->
    <script src="https://code.jquery.com/jquery-latest.js"></script>

    (only if your theme isn’t already using jQuery)

    Then, add this code to the footer.php file of your theme :

    <script type="text/javascript">
    /* The first line waits until the page has finished to load and is ready to manipulate */
    $(document).ready(function(){
        /* remove the 'title' attribute of all <img /> tags */
        $("img").removeAttr("title");
    });
    </script>

    Yeah. As simple as that.

    Begin with fixing you markup. Invalid markup might be misread by the browser, resulting in strange rendering :

    1. the <body> opening tag is missing
    2. you included
      <a name="top"></a>
      <div id="wrapper">

      twice

    Didn’t investigate further but this CSS should work.

    Can you give a link to the blog? It’s easier to debug when seeing it running live, rather than in multiple files.

    At first sight, two ways come to my mind:

    1. make a lib/ folder at the root of your wordpress install. Both of your plugins target this folder
    • pros : easy maintenance -> you edit your base classes and services one time for all your plugins
    • cons : a pain to re-use if you move your plugins to another wordpress
    • make a lib folder for each plugin
    • pros : all the file the plugin needs are included in the same folder so, easy to move. allows differences in the base classes and services configuration for each plugin
    • cons : you have to update your base classes and services twice :/

    I guess you already reached that conclusion, so I’m not really helping. Maybe someone would have better ideas…

    Hello there,

    It’s a css issue. The content and the sidebar are floating elements. The primary developer forgot to clear the float before displaying the footer.

    You can fix this with only one line of code (you lucky boy!):
    <div class="clear"></div> which is, in your theme, the same as <div style="clear: both;"></div>

    Find in your theme the <div id=”content2″>…</div> and eventually the <div id=”sidebar”>. Write the line of code I gave you beetween the closing tag of the div#sidebar and the closing tag of the div#content2

    The following is a little out of scope of your question.
    There’s also many <div style="clear: all;"></div>. First time I see this and don’t know if this markup is valid… I always use <div style=”clear: both;”></div>

    Yep, sorry about that. Here it is -> https://pastebin.com/3JC53Kkz
    I will keep an eye on this topic, in case it doesn’t suits your need, just tell me

    The theme you use embeds fonts with a JavaScript library called Cufon. There’s a known bug with IE9. See the announcement on this page : https://cufon.shoqolate.com/generate/

    So in order to fix it, you’ll have to replace the js file with the new fix they provide. You can download it here :

    https://cufon.shoqolate.com/js/cufon-yui.js
    (EDIT : URL was wrong)
    Upload it on your host, in the folder wp-content/themes/lightword/js/

    If you’re familiar with HTML, there’s another way explained on the Cufon website (still the same URL as at the beginning of this post)

    Let me know if you encounter any trouble, I’ll try to help.

Viewing 15 replies - 61 through 75 (of 97 total)