In [ ]:
from WPUtil import WPUtil
from wordpress_xmlrpc.methods import posts
wpu = WPUtil()
page = wpu.findPageByTitle('demo')
page.content.splitlines()[0] # print the first line
In [ ]:
wpu.prependToPage(page,'<b>Now we have a new first line</b>\n')
page.content.splitlines()[0] # print the current first line
In [ ]:
page = wpu.findPageByTitle('demo')
lines = page.content.splitlines()[1:] #remove the first line, keeping the rest
page.content = "\n".join(lines) # create new content from the remaining lines
wpu.client.call(posts.EditPost(page.id, page))
page.content.splitlines()[0] # and show the new first line
In [ ]:
result = wpu.createPost('brand new post title','new content', 'podcasts' )