Skip to main content

Questions tagged [paths]

The tag has no usage guidance.

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

Is there a way to get a path to the theme directory without the server name?

I need to use file_get_contents() in my theme to include an SVG file. As far as I know, an obvious way to do this would be the following: file_get_contents("https://example.com/wp-content/themes/...
Ivan Vetoshkin's user avatar
0 votes
1 answer
55 views

wp_enqueue_script() with unknown path and maybe symlink

I'm developing a plugin that may also be used as a library in themes or plugins. I need to enqueue a custom script, but I cannot know the absolute path to the script, as the final location of the ...
Gerard Reches's user avatar
0 votes
0 answers
119 views

How to link the path of a folder situated in public.html for a random video player?

I'm new to coding and I'm struggling a bit with migrating my code to wordpress. I made a Random Video player with PHP to play a random file from specific folder on load. I tested it locally and ...
big beans's user avatar
0 votes
1 answer
42 views

Why isn't my SVG path rotating on scroll on iPhones?

I'm trying to get a path inside an inline SVG in the Header of my website to rotate when the user scrolls the page. It's a really neat feature, but it's not working on some iPhones. Here's the ...
ThatJonWilson's user avatar
-1 votes
1 answer
154 views

How to give path to files in plugins folder?

How to give path to enqueue in functions.php wp-content/plugins/dl-grid-addons/includes/wp-bakery/tsw/tsw-tools/assets/js/tsw-tools.js
015ra's user avatar
  • 9
0 votes
0 answers
68 views

Absolute and relative paths

Hello I am new to this and i want to export my local made website on xampp and add to hosting ( live ) and i need relative paths in theme and everything but i have Absolute how to change it?
Adam's user avatar
  • 1
0 votes
1 answer
50 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 ...
sachla's user avatar
  • 1
3 votes
1 answer
6k 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-...
Milosh N.'s user avatar
  • 205
0 votes
0 answers
26 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....
Dalibor's user avatar
  • 101
1 vote
1 answer
322 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 ...
infonory's user avatar
0 votes
1 answer
261 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/
user3418508's user avatar
0 votes
1 answer
868 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 ...
Roman Kh's user avatar
  • 103
0 votes
1 answer
278 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 ...
Kris's user avatar
  • 11
1 vote
1 answer
80 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 ...
rugbert's user avatar
  • 178
0 votes
0 answers
65 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__) . '...
Sergey Pervushin's user avatar
0 votes
0 answers
207 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: ...
Sanjeet's user avatar
0 votes
0 answers
24 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. &...
jetmir zela's user avatar
0 votes
1 answer
248 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 ...
Merion's user avatar
  • 113
1 vote
1 answer
346 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 ...
Rom Grk's user avatar
  • 111
0 votes
0 answers
21 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 ...
Syntaxed's user avatar
0 votes
1 answer
251 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....
Faruk rıza's user avatar
0 votes
0 answers
568 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: $...
WordCent's user avatar
  • 1,877
2 votes
3 answers
329 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-...
Daniel Smith's user avatar
1 vote
0 answers
21 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 ...
Daniel Smith's user avatar
0 votes
0 answers
80 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 ...
bilcker's user avatar
  • 145
1 vote
1 answer
144 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 ...
Nickey22's user avatar
0 votes
1 answer
407 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( $...
Prashant Patil's user avatar
0 votes
1 answer
146 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 ...
FSK's user avatar
  • 3
0 votes
1 answer
91 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 ...
azhagan's user avatar
  • 15
2 votes
0 answers
215 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 ...
Louis W's user avatar
  • 464
0 votes
0 answers
223 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 ...
fabhack's user avatar
0 votes
2 answers
321 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 ...
Rogério Dec's user avatar
1 vote
0 answers
40 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 ...
firion's user avatar
  • 111
1 vote
1 answer
132 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 ...
Charles Johnson's user avatar
0 votes
1 answer
229 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-...
nickpish's user avatar
  • 217
0 votes
2 answers
291 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 ...
Roman Dornhof's user avatar
1 vote
1 answer
30 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 ...
user131426's 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 ...
Silva's user avatar
  • 9
0 votes
1 answer
470 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: ...
WordCent's user avatar
  • 1,877
1 vote
1 answer
250 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 ...
OsakaWebbie's user avatar
0 votes
0 answers
47 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.
Dom's user avatar
  • 101
0 votes
1 answer
133 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 ...
3000's user avatar
  • 185
1 vote
1 answer
89 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 ...
WordCent's user avatar
  • 1,877
1 vote
2 answers
278 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 ...
Blackbam's user avatar
  • 555
0 votes
1 answer
44 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 ...
NVO's user avatar
  • 143
0 votes
1 answer
527 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
jeff's 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( '...
TorryVic's user avatar
  • 153
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 ...
emcolsson's user avatar
0 votes
1 answer
541 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 ...
bigdaveygeorge's user avatar
3 votes
4 answers
8k 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 ...
Muhammed's user avatar
  • 147