Extract wordpress posts content and category content

This’ll output a CSV export of: Post title Post slug Post content Order ID Category ID Pop this in a file in the root of your WordPress install (e.g. export.php), make sure you change the $category_ids with the IDs of all the specific categories. <?php require ‘./wp-load.php’; header( ‘Content-Type: text/csv; charset=” . get_bloginfo( “charset’ ) … Read more

How to remove “» (title of post or page)”?

Search your code for » and narrow down where it’s referenced. Chances are not many places. Look in all your theme and plugin folders. Even do a grep on the /wp-content folder. grep -winr ./wp-content -e ‘»’ It looks like bad php code — maybe copy/paste where the quotes didn’t match up.

How to limit author related post listing ?

Never, never re-query a native archive – use the pre_get_posts hook to alter the main query: add_action( ‘pre_get_posts’, function ( $wp_query ) { if ( $wp_query->is_main_query() && $wp_query->is_author() ) { $paged = max( 1, ( int ) $wp_query->get( ‘paged’ ) ); if ( $paged === 1 ) { $wp_query->set( ‘posts_per_page’, 10 ); } else { … Read more

Four posts per row [closed]

You need to make two changes in your code Use $i = 1 instead of $i = 0 (before begining of while loop) You have 2 IF condition in which you using % symbol. You need to make changes in first if condition (only in opening ul tag). Just replace if($i % 4 == 0) … Read more

Post Query not working

For the type of your $catId, you must use the cat parameter. You can check here the differents parameters allowed. cat (int) – use category id. category_name (string) – use category slug. category__and (array) – use category id. category__in (array) – use category id. category__not_in (array) – use category id.

How to Query in WordPress which shows Alphabetic Posts?

Assuming the letters are links, then put the letter into the URL as a parameter. E.g.: http://example.com/brands/?letter=N Then, in the code (inside whichever template file will be used here), you need to query the DB for posts/brands beginning with ‘N’. You can either create a taxonomy for letters (https://codex.wordpress.org/Function_Reference/register_taxonomy) and assign each post to a … Read more