2022 Developer Survey is open! Take survey.

Questions tagged [paths]

The tag has no usage guidance.

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

How to add tags under categories

How to add specific tags under categories on Wordpress Main categories on my blog example.com/recipes example.com/fashion example.com/beauty example.com/life I want to add tags under this recipes ...
user avatar
  • 1
0 votes
1 answer
607 views

How to get path or root of plugin folder, not file or dir?

I want to include one file from the plugin root to somewhere in the plugin folder. Folder structure: /plugin /folder <- Can't 'esacpe' from this folder to root /otherfolder /req-file-to-...
user avatar
  • 165
0 votes
0 answers
18 views

Multisite problem with unexisting paths to CSS etc

I have the multisite Wordpress site: domain.com/siteA domain.com/siteB Now when the post is published on main site (domain.com), it looks fine because bunch of resources are OK path: https://domain....
user avatar
  • 101
1 vote
1 answer
46 views

Pulling images from a subdomain

I have created a sub-domain img.domain.com and in the database I have changed the required paths inserting the root and the url to this sub-domain. I have also changed these paths in options.php under ...
user avatar
0 votes
1 answer
105 views

Apply function.php filter only if url not has /amp/

I applied a filter to remove theme styles and javascript in function.php, but I want this to happen only if the url not ends with /amp/
user avatar
0 votes
1 answer
168 views

Add custom path to url to specific pages

Right now all pages path like /faq/ or /about/. I need path like /home/faq/ /home/about. I tried change url slug in edit page. But Wordpress change my home/faq to home-faq. I installed plugin Create ...
user avatar
0 votes
1 answer
118 views

specifying relative file paths in WP with jQuery requests not working

Why does it seem that WP requires me to utilize the entire and true file path instead of being able to use a relative file path? I know for safety its better not to use a true file path. In one of my ...
user avatar
  • 11
1 vote
1 answer
73 views

How much control do we have over CPT rewrite slugs? Can I create a "root" page for my CPT with out the page path, and then have paths for other pages?

Say I have a CPT called I dunno, "Library" which is just a set of "pages" ("has_archive" => false) and the rewrite slug is "library". I also intend to have ...
user avatar
  • 148
0 votes
0 answers
31 views

Error in the paths of one of the plugins when changing the plugin directory

I decided to change the standard path to the plugins folder. Now all my plugins are located in site.com/modules In wp-config I have the following written: define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '...
user avatar
0 votes
0 answers
96 views

How to route root path / to /xyz in nginx?

I am using PHP based application in which i need to configure Nginx. I wanted to forward only path / to /?product_cat=top and all other request will remains same. below is my Nginx configuration: ...
user avatar
0 votes
0 answers
17 views

Include my files in a plugin? [duplicate]

I have problem with including my files into a plugin, mycontactform folder and files within it works fine in localhost and I can do CROD methods but, I don't know how to share my files into plugin. &...
user avatar
0 votes
1 answer
91 views

I'm including a html file in my plugin, but it can't find its css or js files

I'm writing this little plugin and my php file at one point includes a small html file, like this: function draw_editor(){ include HANDLER_INCLUDE_URL.'/draw.html'; } But the problem is, that ...
user avatar
  • 113
1 vote
1 answer
185 views

Added slug after URL permalink last slash returns different content

I'm a webdev but have zero wordpress experience, and I'm helping a friend. So I have permalinks to posts in this format: https://example.com/some-slug/ However for some reason there are also links ...
user avatar
  • 111
0 votes
0 answers
19 views

Failed GET Request From admin.php To Fetch .min.js File From Unminifed Directory

I'm just trying to track down which plugin is making a request for this asset. I'm working with a fresh install of WordPress, Astra theme 2.4.0 and the same version of the Astra Pro plugin, then the ...
user avatar
0 votes
1 answer
24 views

Plugin path comes wrongly

I need import css files from a folder in plugin directory to a plugin php file. I tried plugin_dir_path( __FILE__ ); <link rel="stylesheet" href="<?php echo __DIR__ . '/dahili/bootstrap.min....
user avatar
0 votes
0 answers
324 views

path of wp-content directory when we are on some plugin

I am in a hypothetical plugins root folder. Now I want the path of the wp-content directory. I need its path in some functions. Please guide me. I tried this, but this doesn't seems to work: $...
user avatar
2 votes
3 answers
143 views

How can I get a link path to use for my resources such as JS scripts?

Is there a function that would return the equivalent of plugin_dir_path but it being agnostic of a plugin / theme? JS scripts need to be enqueued as resources, as such, you cannot include their on-...
user avatar
1 vote
0 answers
15 views

Retrieving a path when dealing with composer packages

Within my composer package, I require a script be enqueued, I get its "base" path with plugin_dir_url( __FILE__ ) and then append Assets/JS/my_script.js to get the full path, problem is, if someone ...
user avatar
0 votes
0 answers
71 views

Including $_SERVER['DOCUMENT_ROOT'] to load files outside of wordpress installation doesn't work remotely

I have built a wordpress site locally in a directory /blog I have other site files that are at the web root that I need to access in the WordPress installation, css, js etc. Locally I included the ...
user avatar
  • 145
1 vote
1 answer
65 views

How can i have a custom post type with more slugs for each post?

I have a post type /city/ .. lets say i create a city called toronto with the slug toronto-canada. now i have /city/toronto-canada/ is there a way i can have more paths for each post in the custom ...
user avatar
0 votes
1 answer
181 views

How to get post image root URL?

By using below code, I got Image url like "http://localhost..." but I need root path of that image from "var/www/html/.... " $FeaturedImage = wp_get_attachment_image_src( get_post_thumbnail_id( $...
user avatar
0 votes
1 answer
92 views

I can't load my images from a js file using wp_localize_script

I am using a slider to show my images that works fine on my sit but when I converted my site in to a wordpress theme it started giving me troubles on loading the images, slider is active but images ...
user avatar
  • 3
0 votes
1 answer
86 views

What is procedure to let set path in wordpress?

I have installed a plugin called jsmol2wsp. Now I have a cif and many kinds of file in which I have to upload this files in the wordpress and set the path according to link. I have set the path ...
user avatar
  • 15
2 votes
0 answers
155 views

Alias 'wp-content' directory to something shorter (framework?)

I recall seeing this as a feature of a Wordpress Development Framework, so I know it's possible (can't remember the framework). I am interested in how to condense the Wordpress-generated urls to ...
user avatar
  • 396
0 votes
0 answers
194 views

Right path for renaming a file in uploads folder

I wrote a function in my functions.php which automatically renames images in the uploads folder of WordPress with [rename()][1]. I tried different solutions but I always get the error No such file ...
user avatar
0 votes
2 answers
172 views

'posts' table should not store the absolute image path

I'm having some difficulty in making a sandbox from a website, and one of them is that wordpress is registering the absolute path of the image in posts.guid field: http://example.com/path/image.jpg ...
user avatar
1 vote
0 answers
27 views

Images are searched in the wrong path

I am working on a Wordpress 4.2.2 website which has a LayerSlider implemented in the front page. The slider used to work but some modification was done and now the images are not found. The images are ...
user avatar
  • 111
1 vote
1 answer
93 views

Changing the server path

We have a WordPress multisite set up and working fine, but now the owner wants to change the server path to a different name. Will WordPress be able to automatically continue working with the new ...
user avatar
0 votes
1 answer
176 views

Apply template by path/slug related to custom post type?

I have a custom post type called "project" and an accompanying single view template labeled single-project.php On the landing page for each project, I have sub-navigation that points to separate sub-...
user avatar
  • 215
0 votes
2 answers
191 views

Register additional wp plugin directory

I'm trying to register a subfolder as a plugin path, where my company would keep it's own plugins (e.g. wp-content/plugins/company-name/). I've already found, how to redefine the plugin path with ...
user avatar
1 vote
1 answer
28 views

Theme in wp-content but my index.php search theme files in root

My file is in i.e in domain.com/wp-content/Themename/css/cssfile.css But for example css files are looked in domain.com/css/cssfile How to change this? The site isn't loading anything properly ...
user avatar
-1 votes
1 answer
2k views

Back button to previous page and breadcrumbs

I must add back button only on one page and only when I get to this page from one specific. If I on B Page and go to A Page -> display button od A Page but if I on C Page and go to A Page - button ...
user avatar
  • 9
0 votes
1 answer
308 views

Correct Plugin File Path

Warning: require_once(/assets/MCAPI.class.php): failed to open stream: No such file or directory in /home2/....../wp-content/plugins/bplugin/shortcodes.php on line 148 Fatal error: ...
user avatar
1 vote
1 answer
155 views

Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)

[Note: I'm keeping the following opening paragraph here for posterity, but this is no longer a session issue - something wrong on the server is preventing CSS from displaying.] I asked this question ...
user avatar
0 votes
0 answers
38 views

How to change img src in home-made theme, using Wordpress` live customizer?

I have a home-made slider based on css that is sliding my 'hero' section. I would like to be able to change img src from wordpress panel control, rather than changing html.
user avatar
  • 101
0 votes
1 answer
85 views

Hardcoded paths in my plugin

Sorry for the stupid question: I'm trying to create a basic plugin and from its main file I want to refer files in two directories that are in the same directory as the main plugin. I tried to ...
user avatar
  • 185
1 vote
1 answer
78 views

Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint

<?php echo plugins_url().'/jamesplugin/assets/library/classes/process_mailchimp.php';?> The above is path of a file that is kept in a plugin, but I want to transfer that file to a theme say ...
user avatar
1 vote
2 answers
161 views

Components used in Themes and Plugins: How to get file URL?

In my projects I have some components which I use in a lot of custom Plugins as well as in some custom coded Themes like e.g. admin image or video selectors. Those I am holding in custom git ...
user avatar
  • 495
0 votes
1 answer
31 views

Get not the full path

I'm developing an plugin which downloads an image from an FTP server and places that image in a subfolder of the plugin (like: wp-content/plugins/ftpdownload/download/:id"/image.jpg, where :id is the ...
user avatar
  • 143
0 votes
1 answer
449 views

Relative path not working at all in WAMP local environment

As you can see from below, the logo is in the same folder as header.php. I do the relative image reference in header.php by img src="logo.png" Its not working. Please help Thanks
user avatar
  • 109
3 votes
1 answer
4k views

Hook filter to change wp_upload_dir() path in multisite

The upload directory and URL paths are stored in the options database. You can change them using update_option(): update_option( 'upload_path', ABSPATH . '/path/to/uploads' ); update_option( '...
user avatar
  • 133
0 votes
1 answer
2k views

Img src path from wp-admin

Hi guys I have a quick question: My path which I used for images in the php-files locally was something like this: src="<?php echo THEME_IMG_PATH; ?>/icons/cv_icon.png" But from the wp-admin ...
user avatar
0 votes
1 answer
415 views

Unexpected plugin_dir_path Output

I am developing locally and have a problem with this code: plugin_dir_path( __FILE__ ) . 'ben/' If I echo this out it is: C:\xampp\htdocs\plugintest\wp-content\plugins\my-plugin\admin/ben/ If I ...
user avatar
3 votes
4 answers
5k views

How to inject custom url path for page ?

Is it possible to make custom URL path for pages ? The current page url is http://localhost.dev/insight which I need to show like http://localhost.dev/city/local/insight are any option in wordpress ...
user avatar
  • 147
0 votes
1 answer
163 views

How to have a custom URI path for specific page template

I have a custom template file called page_system.php. I have a page in Wordpress called "System" which uses this template. The path to view this page is: www.mysite.com/system/ I want a way via ...
user avatar
  • 13
1 vote
1 answer
182 views

WP Paths in a Plugin - how to include

I'm working on my first WP plugin, and I'm having trouble getting a file include to work. My directory structure looks like this: myPlugin classes templates css js myplugin.php My main plugin file ...
user avatar
0 votes
1 answer
725 views

get_attached_file returns wrong path after changing media upload dir

I've changed the default WordPress media upload dir (http://example.com/wp-content/uploads) to (http://example.com/uploads). Everything is OK and media files are uploading and showing correctly. But ...
user avatar
0 votes
1 answer
17 views

What setting should I configure to move new site folder?

I have a live site and a new wordpress site. The new wordpress site is ready to replace the live site. I want to move the new site folder /public_html/wordpressnewsite to /public_html/ but I afraid ...
user avatar
  • 105
5 votes
3 answers
8k views

How to display a raw HTML page (bypassing WordPress theme, scripts, etc)

I'm a software engineer with a WordPress site with hundreds of pages, and it's working very well. There are certain cases, however, where I'd love to be able to code my own page with no interaction ...
user avatar
  • 225
1 vote
1 answer
8k views

Problem with loading images from child theme CSS file with relevant path

I am getting an issue with loading relevant images within CSS file from a child theme directory. I placed - Sites: example.com OR sub-domain.example.com body{ background-image: url(/wp-content/...
user avatar
  • 237