şükela:  tümü | bugün sorunsallar (3)
603 entry daha
  • --- spoiler ---
    lan bu platformda her şeyi yapmayı öğrendim bir tek haberlere "google news" abone ol butonu ekleyemiyorum. bakmadığım forum, denemediğim plugin kalmadı. kardeşim nasıl yapılıyor bu?
    --- spoiler ---

    senin için kod yazdım. $googleurl = değişkenini düzenle, kodları da functions.php dosyana ekle. sonuç: görüntü kodun da temiz: görüntü dosyayı da indirebilirsin: /google-haberler.7z (satır düzenini takip etmek için dosyayı indirirsen; functions.php'de <? başlangıç etiketini alma)

    _____________________________
    // google haberler abone ol -eksisozluk @yazanbiri
    add_filter('the_content','google_haberler_wpenvolay');
    function google_haberler_wpenvolay($content) {
    if(is_single() && !is_home()) { /*varsayilan blog yayinlarina git*/
    $googleurl = 'https://news.google.com/…s?hl=tr&gl=tr&ceid=tr:tr'; /*yayin sayfasina bir baglanti ver*/
    /*$google .='<center>'; varsayilan left - not etiketini sil*/
    /*google-news.svg kordinatlari - w3 standartlari ile olusturulan bir svg dosyasinin kordinatlarini al - kordinatlari bir editor ile al */
    $google .='<a class=google-haberler id=haber href="'.$googleurl.'" target="_blank"><svg width="400" height="auto" viewbox="0 0 540 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
    <g transform="translate(-20.000000, -464.000000)">
    <g transform="translate(20.000000, 464.000000)">
    <g transform="translate(28.500000, 13.000000)">
    <g fill-rule="nonzero">
    <path d="m9.86934039,8.74782443 l9.86934039,11.3753761 l16.1498297,11.3753761 c15.9575698,12.8493685 15.466239,13.92816 14.7185617,14.6865184 c13.7999868,15.6050934 12.3687188,16.6091172 9.86934039,16.6091172 c6.00278062,16.6091172 2.9800281,13.4902347 2.9800281,9.62367499 c2.9800281,5.75711523 6.00278062,2.63823277 9.86934039,2.63823277 c11.9521557,2.63823277 13.4795536,3.4606778 14.6010696,4.51810713 l16.4489006,2.67027608 c14.8894594,1.15355927 12.795963,0 9.86934039,0 c4.57151265,0 0.117492147,4.31516614 0.117492147,9.61299388 c0.117492147,14.9108216 4.57151265,19.2259878 9.86934039,19.2259878 c12.7318763,19.2259878 14.8894594,18.2860506 16.5770739,16.5343495 c18.3074128,14.8040106 18.8521491,12.3580377 18.8521491,10.3927145 c18.8521491,9.78389155 18.8094247,9.21779302 18.7132948,8.74782443 l9.86934039,8.74782443 z" id="path" fill="#4285f4"></path>
    <path d="m26.7027608,6.61160357 c23.2741263,6.61160357 20.475677,9.21779302 20.475677,12.8173252 c20.475677,16.384814 23.2741263,19.0230468 26.7027608,19.0230468 c30.1313953,19.0230468 32.9298446,16.3954951 32.9298446,12.8173252 c32.9298446,9.21779302 30.1313953,6.61160357 26.7027608,6.61160357 z m26.7027608,16.5770739 c24.8228864,16.5770739 23.1993586,15.0283138 23.1993586,12.8173252 c23.1993586,10.5849744 24.8228864,9.05757646 26.7027608,9.05757646 c28.5826351,9.05757646 30.206163,10.5849744 30.206163,12.8173252 c30.206163,15.0283138 28.5826351,16.5770739 26.7027608,16.5770739 z" id="shape" fill="#ea4335"></path>
    <path d="m57.2293569,8.00014713 l57.133227,8.00014713 c56.524404,7.27383204 55.3494826,6.61160357 53.8648091,6.61160357 c50.7672888,6.61160357 48.0649694,9.31392296 48.0649694,12.8173252 c48.0649694,16.2993652 50.7672888,19.0230468 53.8648091,19.0230468 c55.3494826,19.0230468 56.524404,18.3608183 57.133227,17.613141 l57.2293569,17.613141 l57.2293569,18.4783105 c57.2293569,20.8495156 55.9583055,22.120567 53.9182146,22.120567 c52.2519623,22.120567 51.2158952,20.9242834 50.788651,19.9095784 l48.4174459,20.89224 c49.1010365,22.5371301 50.9061432,24.5558588 53.9182146,24.5558588 c57.1118648,24.5558588 59.8141842,22.6759845 59.8141842,18.0937907 l59.8141842,6.9320367 l57.2293569,6.9320367 l57.2293569,8.00014713 z m54.0997934,16.5770739 c52.219919,16.5770739 50.788651,14.9749082 50.788651,12.8173252 c50.788651,10.6276988 52.219919,9.05757646 54.0997934,9.05757646 c55.9583055,9.05757646 57.4109357,10.6597421 57.4109357,12.8386874 c57.4216168,15.0069516 55.9583055,16.5770739 54.0997934,16.5770739 z" id="shape" fill="#4285f4"></path>
    <path d="m40.5881964,6.61160357 c37.1595619,6.61160357 34.3611126,9.21779302 34.3611126,12.8173252 c34.3611126,16.384814 37.1595619,19.0230468 40.5881964,19.0230468 c44.0168309,19.0230468 46.8152802,16.3954951 46.8152802,12.8173252 c46.8152802,9.21779302 44.0168309,6.61160357 40.5881964,6.61160357 z m40.5881964,16.5770739 c38.708322,16.5770739 37.0847942,15.0283138 37.0847942,12.8173252 c37.0847942,10.5849744 38.708322,9.05757646 40.5881964,9.05757646 c42.4680708,9.05757646 44.0915986,10.5849744 44.0915986,12.8173252 c44.0915986,15.0283138 42.4680708,16.5770739 40.5881964,16.5770739 z" id="shape" fill="#fbbc05"></path>
    <polygon id="path" fill="#34a853" points="61.950405 0.256346504 64.6313622 0.256346504 64.6313622 19.0230468 61.950405 19.0230468"></polygon>
    <path d="m72.9092181,16.5770739 c71.5206745,16.5770739 70.5380129,15.9468887 69.8971466,14.6971995 l78.1963647,11.2685651 l77.918656,10.5636122 c77.405963,9.17506861 75.8251595,6.61160357 72.6101471,6.61160357 c69.4164969,6.61160357 66.756902,9.12166308 66.756902,12.8173252 c66.756902,16.2993652 69.3844536,19.0230468 72.9092181,19.0230468 c75.7503918,19.0230468 77.3952819,17.2820268 78.0788725,16.278003 l75.9640139,14.8680972 c75.259061,15.8934832 74.2977616,16.5770739 72.9092181,16.5770739 z m72.7169582,8.94008431 c73.8171119,8.94008431 74.7570491,9.50618284 75.0668011,10.3072657 l69.4592214,12.6250653 c69.4592214,10.0188758 71.3070524,8.94008431 72.7169582,8.94008431 l72.7169582,8.94008431 z" id="shape" fill="#ea4335"></path>
    </g>
    <path d="m85.938616,19.1673004 l85.938616,2.15753612 l88.5993612,2.15753612 l96.8666768,15.3899924 l96.9617034,15.3899924 l96.8666768,12.1115741 l96.8666768,2.15753612 l99.052289,2.15753612 l99.052289,19.1673004 l96.7716502,19.1673004 l88.1242281,5.29341445 l88.0292015,5.29341445 l88.1242281,8.5718327 l88.1242281,19.1673004 l85.938616,19.1673004 z m107.367118,19.5474068 c105.609117,19.5474068 104.179772,18.9614152 103.079042,17.7894144 c101.978311,16.6174137 101.427954,15.136597 101.427954,13.3469202 c101.427954,11.6522704 101.962474,10.1952102 103.031529,8.97569582 c104.100583,7.75618148 105.466577,7.14643346 107.129551,7.14643346 c108.855877,7.14643346 110.237708,7.70866865 111.275087,8.83315589 c112.312467,9.95764314 112.831148,11.4622162 112.831148,13.3469202 l112.807392,13.7507833 l103.613567,13.7507833 c103.676918,14.9227841 104.068899,15.8492843 104.789521,16.5303118 c105.510143,17.2113393 106.353496,17.5518479 107.319605,17.5518479 c108.887552,17.5518479 109.948671,16.8866682 110.502996,15.556289 l112.451042,16.3640152 c112.070933,17.2667726 111.445348,18.0230185 110.574266,18.6327757 c109.703184,19.2425328 108.634146,19.5474068 107.367118,19.5474068 z m110.502996,11.9452776 c110.455483,11.2800879 110.150609,10.6465835 109.588365,10.0447452 c109.026121,9.442907 108.190687,9.1419924 107.082038,9.1419924 c106.274308,9.1419924 105.573493,9.39539417 104.979574,9.90220532 c104.385655,10.4090165 103.977836,11.0900337 103.756106,11.9452776 l110.502996,11.9452776 z m127.560274,19.1673004 l125.327148,19.1673004 l122.428837,10.2347985 l119.554281,19.1673004 l117.344913,19.1673004 l113.591361,7.52653992 l115.872,7.52653992 l118.461475,16.3165019 l118.485232,16.3165019 l121.359787,7.52653992 l123.616669,7.52653992 l126.491224,16.3165019 l126.514981,16.3165019 l129.0807,7.52653992 l131.313825,7.52653992 l127.560274,19.1673004 z m137.062935,19.5474068 c135.764232,19.5474068 134.691234,19.2306546 133.843909,18.5971407 c132.996584,17.9636267 132.374958,17.1717462 131.979011,16.2214753 l133.927057,15.413749 c134.544733,16.8708311 135.597934,17.5993612 137.086692,17.5993612 c137.76772,17.5993612 138.325995,17.4489039 138.761536,17.1479848 c139.197077,16.8470657 139.414844,16.4511254 139.414844,15.9601521 c139.414844,15.1999354 138.884284,14.685213 137.823148,14.4159696 l135.47124,13.8458099 c134.726861,13.6557557 134.022087,13.2954501 133.356897,12.7648821 c132.691708,12.2343142 132.359118,11.5176623 132.359118,10.6149049 c132.359118,9.58544479 132.814449,8.75001081 133.725125,8.10857795 c134.635802,7.46714508 135.716719,7.14643346 136.967909,7.14643346 c137.997369,7.14643346 138.91595,7.38003822 139.723681,7.84725475 c140.531411,8.31447128 141.109484,8.98361035 141.457916,9.85469202 l139.557384,10.6386616 c139.129762,9.60920144 138.242856,9.09447909 136.896639,9.09447909 c136.247287,9.09447909 135.700889,9.22909878 135.25743,9.49834221 c134.81397,9.76758563 134.592243,10.1318507 134.592243,10.5911483 c134.592243,11.2563379 135.106966,11.7077098 136.136426,11.9452776 l138.440821,12.4916806 c139.533633,12.7450862 140.341351,13.1806205 140.864,13.7982966 c141.386649,14.4159727 141.64797,15.1128276 141.64797,15.8888821 c141.64797,16.9341801 141.220354,17.8052487 140.36511,18.5021141 c139.509866,19.1989794 138.409152,19.5474068 137.062935,19.5474068 z" id="haberler" fill="#5f6368" fill-rule="nonzero"> </path>
    </g>
    </g>
    </g>
    </g>
    <style> .abone-ol {font: normal 22px sans-serif; fill: #5f6368;} </style>
    <text x="180" y="32" class="abone-ol">abone ol</text> </svg>';
    $content .= $google;
    }
    return $content;
    }
    _____________________________

    // svg ikonun boyutu için bu satırı düzenle: width="400" height="auto"
    // sayfadaki kenar ve üst boşluklar için aynı satır: viewbox="0 0 540 50"

    // abone ol metin kordinatlarını değiştirmek için eksenler: "180" y="32"
    //metin renk / stil örnek: {font: bold 19.5px sans-serif; fill: gray;} </style>

    not: class'lar verildi / hazır. stil dosyası veya php stili kullanarak düğme görünümü de verebilirsin. not 2: bu dugmeyi haber siteleri nasil kullaniyor; gormedim ve hic dikkat etmedim. url kullandim; eger google -script'i veriyorsa- dis baglanti yerine direkt abone de olur. ikon gibi planlamasaydik bir class verip dogrudan ham css'ye geçerdik, fakat php ile yapmak css'den daha hizli ve kolaydi.

    /*düzenleme*/ içerikten önce görüntülemek için yapılan değişiklik yeşille vurgulandı: görüntü
37 entry daha