WordPress: Cuardaigh agus Ionadaigh MySQL ag úsáid PHPMyAdmin

wordpress

Rinne mé mionathrú ar leagan amach mo leathanaigh inniu. Tá sé léite agam Blag John Chow agus ar Blag Problogger go bhféadfadh méadú mór ar ioncam teacht as d’fhógra laistigh de chorp poist. Tá Dean ag obair ar a chuid freisin.

Ar shuíomh Darren, scríobhann sé nach bhfuil ann ach gluaiseacht súl an léitheora. Nuair a bhíonn an bhratach ag barr an leathanaigh, scipeann an léitheoir air gan aon fhócas. Mar sin féin, nuair a bheidh an fógra ar thaobh na láimhe deise den ábhar, beidh an léitheoir ag dul thar fóir leis.

Tabharfaidh tú faoi deara go ndéanaim iarracht fós mo leathanach baile a choinneáil glan - fógraí a chur taobh amuigh de na blagálacha. Táim cinnte go bhféadfadh sé sin níos mó ioncaim a thabhairt dom dá n-athróinn é sin agus iad a dhéanamh níos ionsaithí; throid mé é sin i gcónaí, áfach, mar chuirfeadh sé isteach go mór ar na léitheoirí is mó a bhfuil cúram orm - na cinn a thugann cuairt ar mo leathanach baile go laethúil.

Ceann de na ceisteanna a bhain leis an bhfógra seo a chur i gceart ná gurbh é seo an áit a gcuirim grafach go minic chun críocha aeistéitiúla agus chun mo bheatha a ghléasadh é a dhifreáil ó fhothaí eile. De ghnáth déanaim píosa gearrthóg a mhalartú ar dheis nó ar chlé sa phost ag úsáid:

Íomhá ar chlé:


Ceart Íomhá:


Nóta: Is maith le daoine áirithe stíleanna a úsáid chuige seo, ach ní oibríonn an t-ailíniú i do bheatha ag úsáid CSS.

Gach post a nuashonrú ag úsáid Cuardaigh agus Ionadaigh:

Chun íomhá aonair riamh a mhodhnú go héasca i ngach post amháin chun a chinntiú go bhfágtar údar maith le mo chuid íomhánna is féidir é a dhéanamh go héasca trí cheist Nuashonraithe a úsáid i PHPMyAdmin do MySQL:

nuashonraigh table_name set table_field = cuir in ionad (table_field, 'replace_that', 'with_this');

Sonrach do WordPress:

nuashonrú `wp_posts` set` post_content` = cuir in ionad (`post_content`, 'replace_that', 'with_this');

Chun m’eisiúint a cheartú, scríobh mé an fiosrúchán chun “image =‘ left ’” a chur in ionad “image =‘ right ’”.

NÓTA: Bí cinnte go cúltaca do chuid sonraí sula ndéanfar an nuashonrú seo !!!

16 Comments

  1. 1
  2. 3

    Thanks for providing further information on this topic. I’ve seen ads left or right justified before on other web sites so it does seem a popular place. Your ads flow nicely on the right of the post.

    I may switch to right justifying my ads too in the near future. It would be interesting to see if any further revenue is generated as a result.

    • 4

      I’m going to definitely track them. Overall impressions are down a little right now, so revenue is also lagging. I’m going to give it a few weeks to see! I’ll be sure to report on it.

  3. 5

    Do you get anything with the banner ads on your index page, Doug? I didn’t do well with them.

    In general, the in-post ads (180 and 250 wide) and the ads after a post (336 wide) have gotten the most attention.

  4. 7
  5. 9

    have a problem to update secondds with “right” join in mysql
    UPDATE ivr_data SET RIGHT( TIME, 2 ) = ’00’ WHERE RIGHT( TIME, 2 ) != ’00’;

  6. 10

    Hey Doug. Just used your instructions to update my email address in my WP DB. Worked like a charm. Thanks.

    BTW, came across this post in Google, searching “using mysql search replace query.” Came up 3rd.

  7. 12

    this seemed to work better for my mysql…..

    UPDATE wp_posts SET post_content = replace( post_content, ‘replace this’, ‘with that’ ) ;

  8. 13

    D'oibrigh sé seo dom

    UPDATE wp_posts SET post_content = REPLACE( post_content, ‘www.alznews.net’, ‘www.alzdigest.com’ ) ;

    possibly the ‘replace’ needed to be capitalized

  9. 14
  10. 15
  11. 16

    I recently wanted to replace a string within MySQL on the fly, but the field could contain 2 items. So I wrapped a REPLACE() within a REPLACE(), such as:

    REPLACE(REPLACE(field_name, “what we are looking for”, “replace first instance”), “something else we are looking for”, “replace second instance”)

    This is the syntax I used to detect a boolean value:

    REPLACE(REPLACE(field, 1, “Yes”), 0, “No”)

    Tá súil Cuidíonn seo!

Cad é do bharúil?

Úsáideann an suíomh seo Akismet chun spam a laghdú. Foghlaim conas a dhéantar próiseáil ar do chuid tráchta.