Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Dustie

    (@dustie)

    Thank you, the corrected snippet worked.

    I actually made a mistake in my translation file, which is why I thought the wpadverts text domain was failing within the GDPR snippet, but it is working now!

    Your plugin seems pretty promising, it would be great if the options available through snippets were implemented in the plugin itself and available through built-in options. I’m convinced it would elevate its popularity.

    Thread Starter Dustie

    (@dustie)

    Thank you, I managed to get the GDPR snippet to work as a plugin. I will try with the file upload limit one later.

    But the code you provided when placed in functions.php causes the Add form disappear completely…

    Also, I’m having an issue with translations in the GDPR snippet “plugin”, namely with the text domain. In the snippet code, the translations use “adverts” as text domain, even though from the WPAdverts installation files I know that the correct text domain is wpadverts (translation files are named WPAdverts). But when I use “wpadverts” as text domain in the snippet plugin, translations refuse to work. I’m guessing this is because the snippet plugin can’t access the WPAdverts plugin translation files and it would require its own text domain, correct?

    • This reply was modified 5 years, 4 months ago by Dustie.
    Thread Starter Dustie

    (@dustie)

    Thank you for your reply.
    I have this in my post/page:

    [catlist id="7" tags="uslugi" template=default]

    And this is my default.php file:

    <?php 
    global $post;
    while ( have_posts() ):
      the_post();
    
      // Check if protected post should be displayed
      if (!$this->check_show_protected($post)) continue;
    $lcp_display_output .= '<div class="list-post-title">';
    $lcp_display_output .= $this->get_post_title($post, 'div', 'imadethis'); 
    $lcp_display_output .= '</div>';
    endwhile;
    ?>

    Still there is no change to anything, the html output is still the original one, with ul/li, lcp_catlist class, etc.

    What am I doing wrong?

    Thread Starter Dustie

    (@dustie)

    Sorry about the late reply,
    My WordPress installation is set to English, however I still use a translations file and provide my own versions/translations of the labels (that way I can change English labels into different/other language ones without changing my whole WordPress installation language).
    I place PO and MO files in my theme languages directory (wp-content/themes/twentytwelve/languages/) and all other texts can be translated fine, only the comment form labels seem to be ignore translations… As explained in the OP, the comments-template.php file clearly shows they should be translated before being printed on the page, but for some reason they aren’t being translated…

    Thread Starter Dustie

    (@dustie)

    Already removed the whole thing, only kept ”, works fine, keeping my fingers crossed, lol. Thank you for help.

    Thread Starter Dustie

    (@dustie)

    I think I found a way to do this as desired. get_the_post_thumbnail uses wp_get_attachment_image to provide a featured image, so I edited wp_get_attachment_image in media.php to consider a ‘retina50’ argument and divide width and height values fetched from the featured image file before returning them in the HTML code.

    Now the question is how can I provide the wp_get_attachment_image function in a different file, so it doesn’t get overwritten with theme updates, sort of like functions.php hooks?

    Thread Starter Dustie

    (@dustie)

    YES that seems to be the code, I was using Find on those files I mentioned in my post to find the $darr; for the arrow but I kept failing. Where does the code you quoted lie in?

    UPDATE
    I found it, it’s in functions.php… comments.php for twentytwelve misguided me by the wp_comment_list reference in it, so I went looking into wp-includes, but seeing the code you quoted with twentytwelve string in it I figured it has to be in the theme folder somewhere.

    Can I just leave erease that part with the span tags and leave it blank, will it work OK?

    Thread Starter Dustie

    (@dustie)

    The thing is I don’t want the images physically reduced in size, which is why the Thumbnail functionality in Media is not suitable, because it physically resizes the images. I need my image files to stay intact. I need this behavior to provide a kind of support for retina displays — I want the IMG tag images to have half (or 3/4) the width and height, while the actual image files are twice (or 1.5) as big in dimension. This will make them appear in my desired size on the page, I will still be able to use the max-width: 100% property to keep them responsive to page width, but on retina displays – which use a “virtual” resolution and have to stretch the images to cover the higher pixel density – they will look better because of their bigger physical size.

    I also want to avoid using JavaScript as there’s a growing tendency to block it, plus it’s generally another extra element to the page I want to avoid. I thought providing reduced width and height values to the HTML code for output in the post thumbnail function is a cleaner way — it would only require the images width and height values divided by 2 or by 1.5 before they’re passed over to the HTML code. I see the function has to fetch those values anyway, so it could just as well alter them for me accordingly, right?

    Post images are easier to deal with, because their HTML size can be controlled with in-line CSS typed into the HTML code of the post, manually and individually. It’s a bit of a hassle, but the post editor allows to have control over each and individual image. For featured images this is not possible – there is no way to control their size individually (except for adding new declarations to the stylesheet each time a new post is made, which is a completely unfeasible), and the Media feature only seems to allow providing different sizes for the images for physical resizing, not for the IMG tag properties.

    I was hoping this simple “Retina support” trick could be achieved using the max-width property, but that one only supports percentage of the surrounding element, not of the IMG width and height values.

    Thread Starter Dustie

    (@dustie)

    There is no issue with permalinks.

    I have actually copied over the .htaccess entries responsible for hotlinking prevention over to the WordPress-generated .htaccess file and it seems to be working (the hotlinking prevention, even with pretty permalinks) for now, so I can see it’s a matter of setting up the Mod Rewrite commands properly.

    Thread Starter Dustie

    (@dustie)

    Why? Is .htaccess behavior something that differs across hosts?

    Thread Starter Dustie

    (@dustie)

    Thanks,

    I used the syntax below:
    <?php echo do_shortcode( '[facebook_like_button]' ); ?>

    within the content.php code and it worked. So far so good.

Viewing 11 replies - 1 through 11 (of 11 total)