• 13-12-2020, 20:08:09
    #1
    örneğin abc.com var ve post olarak blog içerikleri var ben bu blog içeriklerini
    diğer 55 websitemin header altında göstermek istiyorum tıklandığındada abc.com/yazi-adi url sine otomatik linkine kendi gitsin istiyorum nasıl yapılır?
    <script>function do_the_click( tel ){var postdata = 'telno='+tel;$.ajax({url: "http://www.abc.com/wp_call.php",type: "POST",data: postdata,success: function (data) {},error: function(xhr, ajaxOptions, thrownError){},timeout : 15000});}</script>
    böyle bir kod buldum örneğin bu kod wpcall dosyası ile bu tarz çekmeler yapılabiliyor mu?
  • 15-12-2020, 05:05:23
    #2
    sizin paylaştığınız bambaşka bir şey hocam
    aşağıdaki kodu nereye koyarsanız oraya istediğiniz sitenin rss'sinden son 5 yazıyı çekiyor. özelleştirebilirsiniz kolayca da.

    Yardıma ihtiyacınız olursa alıntılayarak konuyu güncelleyebilirsiniz.

    <?php
    // Get RSS Feed(s)
    include_once( ABSPATH . WPINC . '/feed.php' );
    
    // Get a SimplePie feed object from the specified feed source.
    $rss = fetch_feed( 'https://site.com/feed/' );
    
    $maxitems = 0;
    
    if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly
    
        // Figure out how many total items there are, but limit it to 5.
        $maxitems = $rss->get_item_quantity( 5 );
    
        // Build an array of all the items, starting with element 0 (first element).
        $rss_items = $rss->get_items( 0, $maxitems );
    
    endif;
    ?>
    
    <ul>
        <?php if ( $maxitems == 0 ) : ?>
            <li><?php _e( 'No items', 'my-text-domain' ); ?></li>
        <?php else : ?>
            <?php // Loop through each feed item and display each item as a hyperlink. ?>
            <?php foreach ( $rss_items as $item ) : ?>
                <li>
                    <a href="<?php echo esc_url( $item->get_permalink() ); ?>"
                        title="<?php printf( __( 'Posted %s', 'my-text-domain' ), $item->get_date('j F Y | g:i a') ); ?>">
                        <?php echo esc_html( $item->get_title() ); ?>
                    </a>
                </li>
            <?php endforeach; ?>
        <?php endif; ?>
    </ul>
    kaynak