Showing random content / pictures from earlier posts in a sticky post?

I have a sticky post on my wordpress blog, in the beginning. I would like to place some random content in it, by simply replacing some HTML in the post content. The random content would come from earlier posts. For doing this I edited my template’s “blog.php” file, to interact with the main wordpress loop. … Read more

How do I convert a mathematical Microsoft Word document to a WordPress blog post?

I have a Microsoft Word document which I would like to convert to WordPress. The document is in Hebrew. It contains mathematical equations generated with MathType. It also contains images. Just copying and pasting the text of the document to the text area (in WordPress control pannel) wouldn’t work because of the equations and images. … Read more

Prepend regular Posts with custom slug, without affecting Custom Post Types?

My company policy is to prepend “/blog/” to our Post slugs. Normally our SEO team will do this via the Custom Permalinks setting (/blog/%postname%), but this has the side effect of pre-pending /blog/ to other Custom Post Types as well. I know I can set the with_front attribute to false when registering Custom Post Types … Read more

is_singular() not working if called via callback function of admin-ajax.php

In my single.php I’ve some code like this … if(is_singular(‘post’)) { echo ‘Blog’; } else { echo ‘CPT’; } If I approach single.php from blog or CPT index page by using the_permalink(), this condition works correctly. It show ‘Blog’ when I open single blog post and shows ‘CPT’ when I open single CPT. Now the … Read more

Get Content From Blog Page

I have a page that is assigned as the “Blog”. What I’d like to allow is the user to add content to this page then display it before the posts show up on index.php. I thought I used to be able to do it using this method: <?php $blog = get_option(‘page_for_posts’); echo apply_filters(‘the_content’, get_the_content($blog)); ?> … Read more