Articles of theme development

How do I create plugin or theme using MVC pattern?

I am creating theme for property listing and wanted to create a add-on plugin for admin and front end customization using MVC pattern.Does anyone have any solution for same?

How to make native video player full width?

This is what I have now: I want the video player to take up the whole horizontal space and stretch width 100%. The video should also stay responsive, filling the whole video player area. I fallowed advice in this answer and added this to my functions.php: if ( ! isset( $content_width ) ) { $content_width […]

How can I get wp_head() as a string instead of echoing it?

I’m using PHP handlebars templates and would like to keep all of the HTML in the template file so I don’t have a header.php but rather the handlebars looks like <html> <head> {{#wpHead}} </head> where wpHead is a helper that has nothing but wp_head(); but the output comes first before the <html> tag. I’m thinking […]

Recent Posts Not Showing Only On A Specific Category Page

On my blog, for some reason, one of the category pages refuses to load new posts even when I clear all my caches. I’m using WP Super Cache (W3 Total Cache broke my site), Autoptimize and Cloudflare for caching. I doubt the code is the problem since the other category pages are working just fine. […]

Why doesn't my css work when I check my theme on mobile devices?

I am currently in the process of creating my first WordPress theme, and it is going okay, but I have run into an issue. When I try to view my site on either of my mobile devices (tablet and phone) my css is not working. I am connected to the internet on both devices, and […]

How to have this permalink structure: post_type/postname/custom_inner_page

Imagine I have a custom post type called City with custom related meta. The following is working just fine: However, I would like to have an “inner” page listing stuff related to that post in the following way: Inside of which I would query for something like post_type=’stores’, category=’new-york’ If an editor adds […]

Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?

I had used the standard wordpress class entry-title, entry-meta etc, First my theme worked well later all at once the width changed vigorously. Do WordPress generate css properties or can i use my custom markup for posts loop or is it mandatory to follow.

Customizer: save setting/control content to post/page

Is it possible to have a custom Customizer control/setting that saves the content in a new post/page instead of a theme mod/option. Each control would be assigned a post/page, and that control would display a text field for the title post_title and textarea for post_content (also let it save as draft, the default). Also, if […]

Two queries for a WP_User_Query search work perfectly apart, but not together

I’m putting together a page that pulls User data and displays it in an attractive social-media-like format. I want to use a variable passed in through an input on the site to search multiple fields, including a couple custom ones. This works perfectly, yielding any users whose field contents match the fields below. $args = […]

WordPress shows error related to allow_url_fopen

I just installed wordpress with plugins, everything works find except on a ‘contact me’ page, where I can see an error like this. Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/ on line 751 Warning: getimagesize( failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/ on […]