Insert Latest Articles in Homepage

Edit the home page template and add the following code : <h2>Recent Posts</h2> <ul> <?php $args = array( ‘numberposts’ => ‘1’ ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo ‘<li><a href=”‘ . get_permalink($recent[“ID”]) . ‘”>’ . $recent[“post_title”].'</a> </li> ‘; } ?> </ul> I have used <UL> and <li> to list post…. … Read more

Sitewide page on all the blogs in the network

Guess you’re looking for a post or page broadcaster that can help you push post or page creation and update to your multisite blogs. Give these plugins a try: ThreeWP Broadcast Multipost MU (dead link, mirror at the Internet Archive : Wayback Machine)

Show first sentence of blog post in blog roll

Assuming you want to cut off a string after the first full stop you could use something like this: $the-content = “This is the first sentence. And this is the second”; $cut-in-two = explode(‘.’, $the-content, 2); $first-sentence = $cut-in-two[0];

How to Redirect huge numbers of URLs to another URLs?

If /seba-online-form-fill-up-2018.html is an actual WordPress URL then this is relatively trivial to do in .htaccess. For example, the following one-liner using mod_rewrite could be used. This should be placed before the existing WordPress directives in .htaccess: RewriteRule ^\d{4}/\d{1,2}/(.+\.html)$ /$1 [R=302,L] This redirects a URL of the form /NNNN/NN/<anything>.html to /<anything>.html. Where N is a … Read more

How to change the blog title with add_filter? details below

With the filter single_post_title, you can change the page/post title that is set in the <head><title>Page title</title></head>. If you want to change the title that you see in the page header. ( Which i think you want to do). Use this filter: add_filter(‘the_title’, ‘modify_all_titles’, 10, 2); function modify_all_titles($title, $id) { return ‘SOME TEXT BEFORE TITLE … Read more

Side by side blog posts that are tied together

A very simple solution: Add a second editor field to the post editor, and use the meta field content in a filter on the_content. add_filter( ‘the_content’, ‘wpse_77811_extra_content’ ); function wpse_77811_extra_content( $content ) { return $content . get_post_meta($post->ID, ‘_t5_extra_box’, TRUE ); }

All pages showing up as homepage on WordPress website

I have seen this before. It was caused by a permalink saving error, in my case. Go to Settings >> Permalinks. Select a different permalink option than the one you’re currently using. Click “Save Changes” Select the permalink structure you want to use. Click “Save Changes” That fixed it when I encountered the same situation.

Two Blog Layouts, Same Theme

YES! You need 2 custom templates. One for standard view for your visitors and second for your review printout. But you need to create also for that second printout page header and footer manualy and also some functionality. You can’t use the same head and footer from other pages. Or you can but you then … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)