All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Want to know parameters that can be passed to user_can() for access control by user capabilities

I noticed someone else posted the use of user_can() in controlling access permission which appears very useful for an EC site: How to use current_user_can()? As I want to delicately control access ...
0
votes
0answers
30 views

Hide the first two levels in a breadcrumb

I am novice in PHP, and I want to hide the two very first levels in the breadcrumbs - I am using WordPress. Look at the image to understand -it's in Greek- but if you want, take this as example: ...
1
vote
1answer
34 views

Forgot password needs to redirect from wp-login to a custom page

I'm new to WordPress. My question is, Now default user forgot password redirecting to website/wp-login.php?action=lostpassword&redirect_to=http%3A%2F%2website.com%2Fuser-profile But I have a ...
0
votes
0answers
24 views

Add custom taxonomy to editor's side menu

In my theme, I've registered a custom taxonomy and attached it to a custom post type: // functions.php function create_custom_post_type() { register_taxonomy( 'tags', '...
0
votes
1answer
68 views

Is it necessary to sanitize wp_set_password user input?

I'm trying to add a password form to the WP registration form. See the code below. I was wondering if I need to sanitize this specific user input? (and if so how?) If I understand it correctly, WP ...
0
votes
1answer
15 views

Hook for validating and rejecting frontend image upload

I am making a plugin that checks the contents of uploaded images. Right now I am testing if I am using the right hook, so I use getimagesize() to check the image (I am aware this is not the best/most ...
0
votes
1answer
24 views

Fix 'Add Role' Option not there in wordpress 5.2.2

I am making my website on the net and practicing it on localhost wordpress. I want to add a new role in my wordpress, but in both my sites(localhost and internet) I can't find the option to add a role....
0
votes
2answers
34 views

Order Posts in Custom Order

I am trying to create a custom way to order my new custom post type. Here is what I am envisioning: There would be a custom way to order posts in an entirely unique order for display (Number, ...
0
votes
0answers
56 views

Issues adding Recaptcha v3 to Wordpress Registration

I'm having a problem with adding Recaptcha v3 to my WP registration form. The recaptcha seems to be registered and working and communicating with Google's api. I'm running into problems when I try to ...
0
votes
1answer
23 views

Organizing uploaded Media in permalink-based folder structure?

Wordpress seems to like storing files by year/month. This is nice, but not good enough for busy websites with loads of content. It'll be much nicer to have the folders reflect the exact same structure ...
0
votes
0answers
16 views

PHP Widget Showing only for Admin

So I'm adding videos by a PHP widget which u can use shortcodes as well on it, and those videos are accessed by token only, so I need to include another PHP file and echo the $url and everything ...
0
votes
0answers
78 views

How to get WordPress Theme Customizer options in the REST API?

I am trying to work with the WordPress REST Api as a backend for a React application. But I don't understand how to get/fetch the customizer options (check this image for example -> https://imgur.com/...
0
votes
1answer
13 views

How can error pages be customized

Googling this comes up only with information about customizing 404 pages of course, I can't seem to find a way to customize this: I'm using a plugin that allows users to submit stuff in the frontend, ...
0
votes
0answers
50 views

Rewrite for Posttype

i want my posttypes url structure to be /brand/trailer/ instead of /trailer/. I'm not sure how to do this function anhaenger_rewrite() { add_rewrite_rule( 'trailer', 'brand/trailer', ...
0
votes
1answer
17 views

Search for single post by 2 tags

i have "Tag1" and "Tag2" i want to find most recent post with both tags.So far i have tried this, i know im close, but it is listing all posts containing either tag. $args = array( 'relation' ...
0
votes
0answers
62 views

Structuring blog posts page with custom layout

I currently have my reading settings directing post excerpts to a custom blog page, and this works for now. But I want to restructure it to look like this: I currently have the posts and read more ...
0
votes
1answer
18 views

What is the source of the $post_id in a hook argument?

I am learning meta boxes in Wordpress theme development. In a tutorial I watched, tutor wrote a function for saving meta box values. As an argument he add $post_id and $post. I know $post is a global ...
0
votes
1answer
19 views

Show date as permalink for custom post type instead of post name

I created a custom post type and specified a rewrite to change the permalink to /old-donuts/. See code below: function donut_newsletters_post_type() { $labels = array( 'name' => '🍩 ...
0
votes
0answers
24 views

Permalinks are not working in Wordpress

I deployed My Wordpress Blog in one of my subdomains in Digital Ocean. I am running apache2 as my webserver. .htaccess file related to my WordPress installation: # BEGIN WordPress <IfModule ...
0
votes
1answer
15 views

form submission reverts to index.php template

I have created a contact us form which sends an email when submitted. While the email triggers successfully, the submission leads to a page with my index.php template without any change in the URL. It ...
1
vote
0answers
28 views

Read GET parameters in APACHE Mod Rewrite rules for WordPress categories in Posts

I'm a self-taught programmer with a very little experience in WordPress programming. I'm using a post permalink structure in this way: https://domain.com/parent-category/child-category/post-title-...
0
votes
0answers
77 views

Customizing a new page used for blog posts with Avada theme

I'm using the avada theme for my website and I created a page called 'My Blog' and in reading settings I set this to display recent posts. It works, but when I created the page I selected a custom ...
0
votes
1answer
71 views

Peepso: Add extra data field (custom post meta) to postbox

I know that this can be edited in the Peepso core, but I want to be able to update the plugin. I think I found a filter I can use to edit the postbox and allow another field. The form is for the ...
0
votes
0answers
15 views

Can´t update BDD in time

Mi expertise with WP coding is basic, almost reach intermediate level. I know there must be a way to achieve this. I am using 2 loops one inside the other, to find matching values and save in DB. ...
0
votes
2answers
30 views

How to use get_the_title with text on the 'alt' of the_thumbnail array?

I'm currently using <?php the_post_thumbnail('250px', array('class'=>"review-siteshot", 'alt' => get_the_title() )); ?> I know that 'alt' => "review" will output review as all text. I'...
0
votes
1answer
15 views

Remove post content in RSS feed?

I want to remove the post content that is displayed in the RSS feed. How can I do this? I just only want it to show a list of post titles and not the content
0
votes
1answer
21 views

How can I send an email to a user when a post in their category changes

I am trying to send an email to my students when I create a new exercise for them. I create a category that has the same name as the user [student]. Then when I create a new exercise/assignment I ...
0
votes
1answer
16 views

Dynamically display sub-categories on primary menu without adding them

Title says it all i guess. All i need is not having to go on menu and add a sub-cat everytime i create a new one. also, is it possible to order them alphabetically?
0
votes
1answer
48 views

WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()

On plugin activation hook I want to create a table but the following code is giving Uncaught Error. I just wonder why it is not giving this error since I am properly including update.php. global $...
0
votes
0answers
34 views

How to replace wp_ajax_add_tag() error notice on create_term?

I am writing a plugin which uses natural language processing and knowledge graph technology to determine the true entity type of terms added to WordPress, with the purpose of tidying up taxonomies. ...
0
votes
1answer
89 views

Custom Post type shortcodes

I create a custom post type (features) in my theme with Advanced Custom Field. I want to know how i can create a shortcodes of my custom post type. so that i just used a shortcode of that custom post ...
1
vote
1answer
19 views

How to auto empty comment trash after X days

I know how to programmatically delete comments that are X days old but they then go to the trash. How do I empty the comment trash every X days? function ...
0
votes
0answers
20 views

Does it make sense to check a nonce on user log in?

I read the following blog post about implementing custom user log in: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/ In the post, the author walks through some PHP code for ...
0
votes
1answer
12 views

Capture form data in one function and use it in another function (same file)

I'm trying to figure out how to capture data from a form that exists inside a function, and then use it inside another php function. Here's the setup for my .php file: function setPrice( ) { I want ...
0
votes
1answer
31 views

How to get a list of all the years that have posts

All I want is an array of years that posts exist from first to last but for some reason I'm only getting the first two years, 2019 and 2018, when I have posts going back to 2016. Here's my code: &...
0
votes
1answer
14 views

How can I get custom post types to recognize pretty permalink variables?

I'm using PODS to create a custom post type called "automobile" on my site. This results in a permalink structure that looks like this: /automobile/automobile-page I want to be able to send ...
0
votes
1answer
32 views

How to noindex, follow a specific category wordpress?

Google appears to be ignoring my robots.txt (despite being valid) How do I noindex, follow a specific category without plugins?
0
votes
1answer
168 views

Slider Revolution - Uncaught ReferenceError: setREVStartSize is not defined

I am working on WordPress 5.2.2 running php 5.6.30. I was using slider revolution 5.4.8 previously which was being displayed via the shortcode however the Animations were not working I did try several ...
0
votes
2answers
13 views

Assistance with wp_title function

I have this command that I'm using. I want it to use the template formating for the title but I can't figure out how to add it. I found this code online to strip everything and I added <?php ...
0
votes
1answer
31 views

How to customize file path for 404 redirection in php?

I made a plugin with a custom post type postcard. Most of postcards are private. I would like to redirect the logged out user in a specific php file inside my plugin instead of the 404.php or achive....
0
votes
0answers
31 views

How to include React libs in a Wordpress Plugin?

Whilst currently working on a wordpress plugin I’ve stumbled upon some minor issues. In my plugin project I am including the minified version of the React & React.dom.production. Wordpress ...
0
votes
1answer
100 views

Use action, filter, or hook to append HTML to WordPress plugin function

I am new to WordPress actions, filters, and hooks, and am wondering if it is possible to use one of the three to append some HTML to a defined plugin function using the theme's functions.php file. The ...
0
votes
0answers
25 views

How to create a collapsible side menu using a walker?

I'm using wp_list_pages($args) to create a side navigation. I need to make the menu collapsible on mobile. Using a custom walker, 'walker' => new sidebar_walker(), within the $args and then class ...
0
votes
0answers
19 views

Order by meta_key field in Wordpress not meta_value field value

I have a requirement where I need to show all posts having thumbnail first and ordered by title and then remaining posts ordered by title Below is the code I tried $the_page = (get_query_var('paged'...
0
votes
2answers
140 views

Remove nofollow from specific internal links

I got all my website with a lot of internal cloaked links with a nofollow attribute. I need a function or filter to add inside functions.php that removes the nofollow attribute when the permalink ...
0
votes
0answers
16 views

Image from URL Wordpress Plugin

I'd like to know if there is an existing plugin in Wordpress that can do the following - Allows to upload multiple images from URLs - Has the feature to create a gallery/slider/carousel out of the URL ...
0
votes
0answers
9 views

WP Multisite after login in network when try to open subdoamin it again ask login

I have a multisite with latest WP version 5.2 The problem is, When I was login in network and than try to open sub domain site, it can again ask for login. I have try define( 'COOKIE_DOMAIN', '' ); ...
0
votes
1answer
82 views

What is the purpose of WP_CONTENT_URL?

While trying to move the wp-content to new folder, there is constant called WP_CONTENT_URL. Why do we need this one? Does WP_CONTENT_DIR and WP_CONTENT_URL needs to be same? Bcoz there are several ...
1
vote
1answer
26 views

Register vendor JS/CSS only on pages that require them?

I have some JS \ CSS that is used within selected pages on my site for various UI functions, for example an image slider. This image slider is only used on a few pages inside the site and loading it ...
0
votes
1answer
27 views

Blog previews on custom page with more buttons

I currently have a page on my websites called blog where I'm directing blog posts to be previewed, however, I'm trying to achieve a centered preview with a 'more' button like this: Is there a ...

15 30 50 per page