I am trying to display 3 blog posts that have been selected by the user in the admin. The order should go gridItem1, gridItem2 then gridItem3. I have set out my query below but it shows the selected posts but in date order not in the order I have outlined. I have searched other posts and added in the ‘surpress_filters’
Tag: wordpress-theming
WordPress how to get the post thumbnail inside a figure tag
I am running a query loop and want that ‘if’ the post has a featured image, it needs to be inside a <figure> tag. But the featured image’s <img> tag is appearing before the <figure> tag. What could be the reason? The problem can be better understood with this image: Answer It’s because you’re using the_post_thumbnail function which echo the
WordPress how to show all posts in the index page and exclude sticky posts
Since Wordpress sticky posts feature allow the post checked as sticky in post publish panel to be placed at the top of the front page of posts. I want to show all posts in index without sticky posts: Answer You could use pre_get_posts action hook to manipulate the query. Since you need to modify the query on your index.php, the
Modifying single.php on child theme “Mikado Newsflash”
I have a website with “Mikado Newsflash” theme and a custom child theme. I can add functions on child theme and that, but if I modify single.php I get no results. Even if I delete the code on main theme it still works. Is it being called somewhere else? I’ve modified core templates such in framework/modules/blog/templates/singles and no result. Any
WordPress JavaScript
I’m trying to achieve a custom option inside the “Publish Metabox” in WordPress admin custom post. And I want to know is there any native way to do expand/collapse divs (Check the below screenshot). I wonder how WordPress itself achieves it like the below screenshot? (Maybe match the IDs like bootstrap JS libraries do ?). Answer And I want to
How to fix the navigation bar that is in horizontal should be vertical in WordPress?
I am learning how to convert HTML to WordPress theme while converting I face the problem of the navigation bar in the HTML code looks like this. The main HTML website will look like this Now I have enqueued all the style and scripts file but still, it is causing a great problem. It still looks like the pr1 image
Removing admin menu links in wordpress using user ID
This is my code and I dont know why isnt working Answer You misspelled the name edit-comment.php try the below code.
Wrong author ID output from elementor module
I create a module for elementor. I need to display the author name, choosen from the elementor admin control. I have 4 administrator. They show up correctly on control panel: admin (ID=0.) Jhon Doe (ID=1.) Jeane Doe (ID=3.) Mary Doe (ID=5.) The code for Elementor admin panel: When I choose Jeane Doe from Elementor control admin, the output on the
Betheme WordPress How to hide or Remove Admin menu Items
I am using currently Betheme Wordpress and I want to remove admin menu Betheme li Items Kindly view the image what i want is also defined in image Answer I have found the solution and its workig 100% 1st step open this file projectName/wp-admin/admin.php then 2nd Step in footer of the page insert this code Enjoy My Solution …
How to rewrite an echo function to a return value for a WordPress theme
I am new to PHP and I am glad that I have written the following function (which works as it should) on my own so far: But now I definitly need your help… As you can see I want to use this function in a shortcode. Currently it displays first on my page, and Google says, this is because I