Questions tagged [paths]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
6 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 ...
0
votes
1answer
32 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/
0
votes
1answer
29 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 ...
0
votes
0answers
10 views

Best practice for converting legacy structure of blogs.dir to modern site/files path for uploads in site network

On more than one occasion recently I have needed to convert quite large legacy WP Site Network sites using blogs.dir to the current structure using sitename/files, and I am looking for a standard and ...
0
votes
1answer
23 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 ...
0
votes
0answers
12 views

how to change file upload default directory to custom directory

I have created a custom file upload method on wordpress but it only uploads only uploads folder. I want to move it to custom directory on upload directory : like this uploads/my_folder i want to ...
1
vote
1answer
65 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 ...
0
votes
0answers
19 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__) . '...
0
votes
0answers
20 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: ...
0
votes
0answers
9 views

How to include my paths in the right way, that i can get me form complete with css, style in plugins

class contactform{ public function __construct(){ add_action('home.php', array($this, 'enqueue')); add_shortcode('contact', array($this, 'enqueue')); } function activate(){ } function deactivate(){ } ...
0
votes
0answers
16 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. &...
0
votes
1answer
22 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 ...
1
vote
1answer
63 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 ...
0
votes
0answers
17 views

Media permalinks on local and remote server

I am trying to include images and pdf in my WordPress post content. The problem is the permalink I am using only works on local and not on the hosting platform. As all the media files are in the ...
0
votes
0answers
16 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 ...
0
votes
1answer
14 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....
0
votes
0answers
123 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: $...
2
votes
2answers
68 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-...
1
vote
0answers
14 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 ...
0
votes
0answers
68 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 ...
1
vote
1answer
51 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 ...
0
votes
1answer
94 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( $...
0
votes
1answer
42 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 ...
0
votes
1answer
79 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 ...
2
votes
0answers
77 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 ...
0
votes
0answers
137 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 ...
0
votes
2answers
98 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 ...
1
vote
0answers
19 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 ...
1
vote
1answer
84 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 ...
0
votes
1answer
128 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-...
0
votes
2answers
98 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 ...
1
vote
1answer
25 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 ...
-1
votes
1answer
1k 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 ...
0
votes
1answer
241 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: ...
1
vote
1answer
109 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 ...
0
votes
0answers
37 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.
0
votes
1answer
51 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 ...
1
vote
1answer
75 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 ...
1
vote
2answers
100 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 ...
0
votes
1answer
25 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 ...
0
votes
1answer
393 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
3
votes
1answer
3k 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( '...
0
votes
1answer
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 ...
0
votes
1answer
303 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 ...
3
votes
4answers
4k 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 ...
0
votes
1answer
97 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 ...
1
vote
1answer
121 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 ...
0
votes
1answer
641 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 ...
0
votes
1answer
16 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 ...
5
votes
2answers
7k 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 ...