Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Djul

    (@djul)

    up

    Thread Starter Djul

    (@djul)

    A small update for those in the same situation…

    I managed to access PHPlist Admin page after installing the “list” folder (the one in phplist-2.10.13) at the root of my WP installation. You also have to create a database for PHPlist, didn’t tried but it might work with a table on the already existing database (the wordpress one).

    Then you have to go to the adresse of your site (http://nameofyourWPsite/lists/admin).

    You’ll be asked to fill your Id and pass to enter the Admin UI. And I’m stuck here. Invalid password… To be continued.

    Thank you all!
    I get it working locally by duplicating the function, and I renamed the 2nd (changed the size by the way). Then, as vnatura said, all you do is calling <?php getImage(‘1’); ?>,<?php getImageWhateverYoulike(‘1’); ?>…

    But I’m facing another problem now. I uploaded my site, and boom this appears!
    Warning: Cannot modify header information – headers already sent by (output started at /homepages/32/d214056268/htdocs/wp-content/themes/youpie_template/functions.php:4)…

    So I’m trying to find the error in 4th line of my functions.php, but no way. It makes me crazy! Any Php superhero could help me? 🙂

    <?php if ( function_exists ('register_sidebar')) {
    register_sidebar ('custom');}?><!--  la fonction au dessus permet de rendre une div "widget ready"
    Elle est chargée dans le template via l'appel php "get_sidebar ('custom')" -->
    <?php function getImage($num){
    global $more;
    $more = 1;
    $link = get_permalink();
    $content = get_the_content();
    $count = substr_count($content, '<img');
    $start = 0;
    for($i=1;$i<=$count;$i++) {
    $imgBeg = strpos($content, '<img', $start);
    $post = substr($content, $imgBeg);
    $imgEnd = strpos($post, '>');
    $postOutput = substr($post, 0, $imgEnd+1);
    $postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '/width="260? height="150?/',$postOutput);
    $image[$i] = $postOutput;
    $start=$imgEnd+1;
    }
    if(stristr($image[$num],'<img')) { echo ''.$image[$num].""; }
    $more = 0;
    }?><!--  la fonction au dessus permet de charger la première image d'un post. Elle est chargée dans le template via l'appel php "getImage('1')" -->
    <?php function getImageIndex($num){
    global $more;
    $more = 1;
    $link = get_permalink();
    $content = get_the_content();
    $count = substr_count($content, '<img');
    $start = 0;
    for($i=1;$i<=$count;$i++) {
    $imgBeg = strpos($content, '<img', $start);
    $post = substr($content, $imgBeg);
    $imgEnd = strpos($post, '>');
    $postOutput = substr($post, 0, $imgEnd+1);
    $postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '/width="167? height="100?/',$postOutput);
    $image[$i] = $postOutput;
    $start=$imgEnd+1;
    }
    if(stristr($image[$num],'<img')) { echo ''.$image[$num].""; }
    $more = 0;
    }?>
    <!--  la fonction au dessus est identique à la précédente. Elle est
    juste modifiée au niveau de la taille des images pour pouvoir afficher
    les images sur une autre page sans être forcer de garder la taille des
    images de la première fonction.
    Elle est chargée dans le template via l'appel php "getImageIndex('1')" -->

    Hi,
    I found this function really useful, but am facing a problem now.
    I added the code in one of my templates and now I need
    to use the same function in another page but in a different layout.

    I already managed to make pictures displayed on both pages (thanks to a WP_Query for the second). But in the 2nd page, I need the size to be changed.

    How can I make the same function display two different image size?
    And how to control it?
    Hope I’m clear enough, It’s getting quite technical for my english! 🙂

    Thread Starter Djul

    (@djul)

    Oops, found on my own.
    Just forgot open and close brace for the 2nd stylesheet…
    Well I’m not php fluent actually 😛

    Thread Starter Djul

    (@djul)

    Well finally, I find it easier to use differents
    stylesheets to have the “Masonry Layout”. It looks less
    impressive when loading the page, but at least I can
    control the visual and post!

    Thread Starter Djul

    (@djul)

    Thank you David.
    That’s what I found but I’m still searching for the code part. 🙂

    I though I could use something like wp_deregister_style(); in functions.php but I still can’t get it working.

    How would you proceed to enable the plugin on the home, or disable it on the other pages?

    I might sound newbie but I’m stuck with the logic of code…I’m not a poet! 🙂

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