Articles of customization

Insert a field with PREG_REPLACE – strange behaviour

I’m trying to insert a custom field (from the Advanced Custom Fields plugin), and I need to place it within a div which I’m wrapping around an img, right before the img-tag. So basically this is the result I want (I use the_field(‘description’) here to make it cleaner): <div class=”the-content”> <div class=”owl-wrapper”> <div class=”owl-item”> [ […]

How to create a custom WordPress front page

I want to create a custom front page for a WordPress site, which will have an image, some text, an embedded login form, and a metaslider slider, and nothing else (no menu, no sidebar, no footer). Anyone visiting the site should be presented this page, and should be able to login with their credentials. How […]

Custom wp_query – I'm getting 'all' post, not the specific post in the query

Get all post from today, that are of post type ‘product’ and are in the taxonomy of ‘productType’ as ‘Indica’ and in the taxonomy of ‘locationCity’ as ‘Los Angeles’ — However, I get ‘all’ the post with no regards to the query params of the custom taxonomies. // args $today = getdate(); $indicaArgs = array( […]

Adding comments section to website integrated WordPress instance

We’ve integrated a WP instance into our website, and I was wondering how to render the comments template into the page. I’ve tried simply adding: comments_template( ”, true ); But it doesn’t seem to work (also there are no errors shown). I guess we are missing some includes and inits. Any help would be appreciated.

Edit specific text on a static page

I’m kinda stuck with my WordPress development. I must say, I’m a noob at this right now but trying to get more knowledge of this. In WordPress admin, there is this text editor for editing the content on a static page. (in my case) On this static page I’ve got, I have several div’s which […]

Convert Custom Table Data Based Plugin To Be Searchable

I’ve got a client with some very specific requirements for a feature on their WP site for a downloads system. After a lot of scouring of the web I’ve found an old plugin and made a few changes to improve the styling and visual output. The plugin now does 90% of what is needed. However, […]

Add Class according to the order of appearance

My loop returns five posts and the HTML should look like this.. <ul> <li class=”topfive”> … </li> <li class=”topfive”> … </li> <li class=”topfive”> … </li> <li class=”topfive”> … </li> <li class=”topfive”> … </li> </ul> And, I need to programmatically add classes to them according to the order of appearance, something like this.. <ul> <li class=”topfive […]

How to Fix an Archive.php That Displays All Posts?

I am currently working on developing my first large-scale WordPress powered site, and I have run into a major problem in my archive.php file. It loads all posts, rather than the categories/tags that I am looking to display. The basic idea is to have an article-showcase bar in which the first 6 posts will be […]

How to redirect the home page to a custom page?

I had a WordPress site which was moved to a directory called “test”. Now, all the urls for the wordpress site is, /test/wp-admin. The main index page is a custom html page for Now, I want to move the WP back to the root directory but let the point to the same […]

Custom blog setting directs blog to index page

In WordPress, I’ve changed the general settings for my web site to use a static page, pointing the Front page to a custom page called ‘Home’ which inherits from a template page called tpl-home.php and I set the Blog to a custom page, called ‘Blog’ which inherits from my default blog.php page. However, when I […]