React to WordPress - Page 2 of 2 - by kirillrocks

How to Open Android AVD/SDK (Android Virtual Device) manager inside Webstorm / Phpstorm on Windows (simple workaround)

Some of you might think “why would I need to open AVD inside Webstorm?”, and maybe even be correct, as the newest versions of Android Studio working on the Intellij Engine as well(and also doing it pretty well).

But, the programmers that are working with WebStorm or PhpStorm on the daily, they wouldn’t want to move to Android Studio every time they decide to work on a React Native project.

As one of those “programmers”, I have found a simple workaround that works for me. Follow this steps, and you will be able to use Android AVD within WebStorm in no-time.

Read More

Using same slug for custom post type and custom taxonomy

It is fairly common that you, as a website manager, would like to use the same slug for custom post type as for custom taxonomy, but it is not a simple thing to do if you are not familiar with WordPress permalink structures.

I will explain, say your archive page is `www.domain.com/web-tutorials` – that is the page that will hold all of your posts under the `web-tutorials` custom post type. Now you want your web-tutorial(a singular post) URL to be www.domain.com/web-tutorials/taxonomy-category/post-name

web-tutorials Will be your custom post type slug.

taxonomy-category Your taxonomy category.

post-name Will be your post name/title.

It is impossible to do so without coding customizations, and to my surprise, it is a simple one.

Read More

How to adjust post content before echoing it to the screen?

This one will be quick, I will show you how to adjust, change, nor filter the post’s content before echoing it to the screen.

It is fairly straightforward , you just need to use a WordPress filter for that

add_filter( 'the_content', 'filter_function_name' );

filter_function_name( $content ) {

    if ( is_single() ) {
        $content = str_replace( '<p>', '<p class="p-class">', $content );
    }

    return $content; // a must - return content in any case

}

Read More