Articles of theme development

Disable wp_enqueue_style for theme on wp-admin

At this moment I use functions as described in the “Theme handbook” from the WordPress site. The problem is that the stylesheet is loading on the backend pages too and it affects the layout of the backend pages. This behavior is not wanted. The code I use to load the stylesheet -> https://pastebin.com/rAMZSu3u Does anyone […]

How to get comment meta values by post ID

I can get comment meta value by a comment ID. But if I want to retrieve a comment meta value of a single post’s comments, how should I go?

What does WordPress do if I save a post without content/title?

I’ve created (as part of a theme) a few metaboxes for my post type. The metaboxes allow the user to interact with different instances of tinyMCE. Everything is working as it should, however, I can’t for the life of me figure out which hook to use for publishing a post that is missing a title/content. […]

Want to add cart and a search bar in the right of logo line

Hi actually in the theme there is a system to keep cart and search bar on the menu.But i want in the right of logo. How can i add this?please help me. My site link–http://girlesse.virtumultimedia.com/

How do I modify the 'more' link in a feed

I use a function to modify the ‘read more’ link for posts. function modify_read_more_link() { return ‘<p class=”read-more”><a href=”‘ . get_permalink() . ‘”>CONTINUE READING &raquo</a></p>’; } add_filter( ‘the_content_more_link’, ‘modify_read_more_link’ ); I want to use different text for the feed, and wonder whether this can be done using a conditional if is_feed() tag? (I don’t know […]

Widget for specific category

Hello every i am new to wordpress. I want to make my own widget which have a category selection option on backed and able to display posts from selected category on front.

WP_Customize_Color_Control omitting # symbol

I am developing a theme and am struggling with WP_Customize_Color_Control. Sometimes it includes the # symbol before the color’s hex and sometimes it doesn’t. I have triple checked my code and cannot see why header_textcolor is the only color to omit it’s # symbol before the hex value in the resulting stylesheet (which prevents it […]

Create a Grid/List Toggle in WordPress Archive

I am building a website that will display posts in a list fashion, and will have a toggle to switch the view to a grid. There will be slightly different content displayed, so I will need to have two different loops. What is the best practices for handling something like this? Should I have a […]

How to add extra input fields to CPT's comment form?

I found filter hooks to add/modify the WordPress default comment form. But I couldn’t find how to add extra fields to a CPT’s (custom post type) comment form. I actually want to know the right way of adding extra input fields like “Rating” field, “First name” field, “Last name” field etc to a custom post […]

how to change WordPress menu markup/classes

I’m building my first website on WordPress, and i wanted to ask is someone know how to change markup in WordPress menu. Basically I want the markup of my WordPress navigation to match what I’ve done in my static templates. <div class=”topNav”> <ul> <li><a href=”#”>About</a></li> <li><a href=”#”>Mes siūlome</a></li> <li class=”dropdown”> <a class=”dropbtn”>if Has subMenu</a> <div […]