I've created a Custom Post Type and a Custom Taxonomy. In WP Admin, how can I limit amount of taxonomy terms that are added to the custom post type? I want to add no more than one tag into the post. After adding one tag, adding more should be disabled or a message should appear. Any help appreciated much.
Thank you for reading this question I need an option or code for each user in each role to see only their posts at the front end, and other users' posts to be completely hidden from them, even in search results (without any messages or effects). More details: The user has to log in to receive the content, and when they log in, they only sees their posts (as if there are no other posts on the website). I need …
I have the following query running to grab post revisions to show specific data on the front-end to users... $postType = 'items'; $metaKey = 'price'; $query = " SELECT c.meta_value,post_modified FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = %s AND c.meta_key = %s order by post_modified DESC "; $metaValues = $wpdb->prepare($query, [$postType, $metaKey]); $metaValues = $wpdb->get_results($metaValues); Once the data is gathered, it only seems to return …
I need to know what the wp specifications for the usernames are. Like allowed minimum and maximum length, are special characters like ü,ö,ä,ß accepted,..? Unfortunately I couldn't find any insight on this in the interweb. Do you have any?
I would like to use wp_remote_post to retrieve data from an external API. The matter is that the external API only accepts a maximum of 5 requests per second. However, depending on how many users are using the related feature on my website, my website may send more than 5 requests per second. How can I, in Wordpress, enqueue (or limit) the output requests (or the use of wp_remote_post) in order to allow only 5 external API calls per second …
Hello guys I was following this article but the code doesn't seem to do anything. The last one by Maruti Mohanty is doing something , it doesn't allow any files to upload with an error. Set a maximum upload count for users on a specific user role As the title says, I would like to allow a specific user role I have created to only upload one image to his media library. Any ideas how to do that? Thanks John
I've searched and searched, but to no avail - hope you can help! I'm building a subscription based online training site for a client. The service caters to companies, who will buy access for their employees. The service has different types of subscriptions, dependent on the amount of employees they wish to buy access - they can choose to buy access for either 10 to 15, 15 to 25 or 25+ of their employees. Now, the thing is.. If a …
I was wondering if there is a way to make this code limit by category. In other words, if user A has already published 10 posts in category A then he can keep the new ones as drafts in category A or post another 10 in category B. * * @param array $data An array of slashed, sanitized, and processed post data. * @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data. * @see https://developer.wordpress.org/reference/functions/wp_insert_post/#parameters …
I'm digging out on old question as no solution came out. How to limit page pagination I'm looking for a way to limit pages on homepage and categories (archive.php). I have around 200k posts spread into about 50 categories. If I leave the default pagination, homepage has 20k pages. Then most categories have over 5k pages. This will send google in some long long loops... and each time a post is added (200/day) google will start again etc... when all …
I have struggled with this for hours and days. I need good ideas for a fix now. When I do a certain action in WordPress, I sometimes get a Fatal memory error. The error comes after I hit "Update" on a tag/term. The error seems to be related to a WordPress core file. It looks like that the script hit a memory limit at around 700 MB: https://www.screencast.com/t/i6USBKHuWcxS However, the limit on the server is much higher - 5096 MB: …
Hi guys I've searched this for too long and I am getting tired now. I need to set a limit on my post titles but I don't know how to do it. On google there are snippets of 300000000 codes to do the same thing but I don't understand where to put these and HOW. I am a total newbie. I am building my website with Elementor and I need the title to trim at an exact character limit. How …
I have created an account on googiehost and unfortunately the hosting company has limited the file upload size to 2MB. Since the hosting is free on googiehost the hosting provider may not agree to increase the file upload size for just my account. And now i have this Divi theme which is 8 MB in size and i am unable to upload it due to the limit. So i thought off splitting the Divi.zip file into 4 X 2MB chunks …
When uploading with video files to the Media Library, it's apparent that you need to increase the Max upload file size value. But this will be applied to all media types, including images and documents. Is there any way or simple code that can set different size limits based on the file type/extension so that I can grant a large limit for videos, a small limit for images, and a different limit for documents? I think WordPress should handle this …
I'd like to insert a large infographics image into a post. The problem is that WordPress scales the image and applies a limit of 393px in my case. When I try to manually increase it, a red exclamation mark shows up, and won't use the value given by me: How to remove that limit?
Right, I know this question has been asked, but, none have provided me with a workable solution, hoping someone can help. I created a property listing site using the plugin Essential Real Estate. The plugin does offer a solution to limit posts using packages, the problem is that I need individual posts to expire in 6 months, the package solution expires the whole package. So what I want to attempt is to place registered users on roles and them limit …
Background: I tried both https://wordpress.org/plugins/bainternet-posts-creation-limits and https://wordpress.org/plugins/limit-posts/, but they didn't work for some reason with my custom posts. So I decided to write my own php script, which I put into my child theme's function.php, to limit the number of certain custom posts types that certain users can create. Structure: I'm using wordpress 5.4.2 installed on bluehost. I am using geodirectory to create the custom post types (practitioners and organizations) and memberpress to manage permissions. I decided to filter wp_post_data …
The website I am busy working on was built by another company that no longer supports Wordpress so I am looking for help. Below is the PHP for the search function. From the research Ive done it seems they have used the standard Wordpress code. The client has asked that the search only results in the related product. At the moment it is pulls everything with the key phase such as blog posts and titles. <?php get_header(); ?> <div class="content …
I have a crashing jQuery slider that i have been asked to fix. Currently it is loading 128 slides (causing crashed of course), but we only want to see 6. I tried using jQuery to remove() 7th and higher li elements, but the slider still loaded empty slides for those removed. I think the best solution is in the template code anyway. These slides are pulled from posts who have a checkbox created from Advanced Custom Fields named "Featured Item". …
I currently use wpadverts plugin and wants to limit the submission to 10 submit / month. How can I do that? I think I need to make a new row like "form_submissions" in "wp_usermeta" and store every time when the user submitted the form and make a cron task to delete the row value after a month. And I need to query the row value on the form submit page like this: $result = mysqli_query($connect, "SELECT COUNT(*) AS `form_submission` FROM …
I use a theme that have a character limit for shortpost and show [...] at the end of character limit. I want to remove this, so I search for the_excerpt(); and replace with the_content(); The problem solve with normal content but still have problem with image post type and there is <?php the_excerpt(); ?> that when I change this my shortpost act like full post and it's not related to the length of post. I try to open all PHP …