• codestr

    (@codestr)


    Hi,

    I’m looking for a way to display a blog’s recent post’s on a page outside of the wordpress installation. The page is a static HTML page and it’s currently not an option to change it so a PHP loop won’t work. The only options I’ve been able to come up with are creating a seperate php file with the loop inside of it, and displaying it in an iframe, or using something like Feed2JS to just display the RSS feed on the page, but I’d like to be able to pull the images from the posts as well which isn’t an option with RSS.

    Anybody have any experience with this issue or any other ideas?

Viewing 1 replies (of 1 total)
  • capitaine_moyen

    (@capitaine_moyen)

    without php I do not think that is possible

    for your iframe this is cool:

    <script type="text/javascript">
    /* iFrame SSI IV - iframe auto-resize height script
     * ©2008 John Davenport Scheuer
     * This notice must remain for legal use. */
    
    function sizeFrame(){
    if(document.getElementsByTagName('frameset').length||!document.getElementsByTagName('iframe').length)
    return;
    var frEls=document.getElementsByTagName('iframe'), s='scrollHeight',
    frObs=window.frames, o='offsetHeight', b='body', de='documentElement';
    for (var cs, hb, hd, d='document', i = frEls.length-1; i > -1; --i){
    if(frObs[i][d][b].style.overflow)
    cs=frObs[i][d][b].style.overflow;
    frObs[i][d][b].style.overflow='hidden';
    frEls[i].height=10;
    frEls[i].height=Math.max(frObs[i][d][b][o], Math.max(frObs[i][d][de][o],
    (hd=frObs[i][d][de][s]) != (hb=frObs[i][d][b][s])? Math.max(hd, hb):0))+
    (frEls[i].height==frEls[i].offsetHeight&&frEls[i].getAttribute('frameborder',0)!=='0'?4:0);
    frObs[i][d][b].style.overflow=typeof cs=='string'? cs : '';
    };
    if(!sizeFrame.setup){
    for (var i = frEls.length-1; i > -1; --i)
    sizeFrame.loadup(frEls[i]);
    sizeFrame.setup=true;
    }};
    
    sizeFrame.loadup=function(o){
    if ( typeof window.addEventListener != "undefined" )
    o.addEventListener( "load", sizeFrame, false );
    else if ( typeof window.attachEvent != "undefined" )
    o.attachEvent( "onload", sizeFrame );
    else {
    if ( o.onload != null ) {
    var oldOnload = o.onload;
    o.onload = function(e) {
    oldOnload(e);
    sizeFrame();
    };
    }
    else
    o.onload = sizeFrame;
    }};
    
    if(document.getElementsByTagName&&window.frames)
    sizeFrame.loadup(window);
    </script>
Viewing 1 replies (of 1 total)

The topic ‘Embedding Recent Posts Outside of WordPress’ is closed to new replies.