I have a wordpress multisite. But I tried to find a recipe or tutorial on how to create a multisite-pod. There is none! Not a single example.
Could someone post an example please? How to use a pod within a template.php?
The structure of my domains/mapping:
example.org
network.example.org // define('DOMAIN_CURRENT_SITE', 'network.example.org');
example.org
example.de
The necessary fields are: name, content, link(german), link(english)
Related
I am struggling with a solution to my problem with a recent wordpress site transition. My old wordpress site had /blog/%category%/%postname%/ as the permalink. With the new site we have changes that to: /news/%category%/%postname%/
I then made a Rewrite Rule to redirect all existing blog posts:
RewriteRule ^blog/(.*) /news/executive-insights/$1 [R=301,L]
However, I didn't realize at the time that this also broke all archive URL paths.
Example:
https://www.example.com/blog/2022/04/29/ now redirects to a 404 page of:
https://www.example.com/news/executive-insights/2022/04/29/
1.) I either need a fancy way to exclude archive directory(2022,2021,2020, etc.) from the rewrite rule.
2.) Or I need a way to include /executive-insights/ as part of the archive URL path instead of: https://www.example.com/news/2022/04/29/
PS- Please don't tell me to update my custom permalink to include year/month/day that is not a solution.
This solved my problem:
//===========================================================
// START - Add /executive-insights/ into the archive url path
//===========================================================
function change_archive_links() {
global $wp_rewrite;
// add 'archive'
$wp_rewrite->date_structure ='news/executive-insights/%year%/%monthnum%/%day%';
}
add_action('init','change_archive_links');
//===========================================================
// END - Add /executive-insights/ into the archive url path
//===========================================================
Shout out: How can I change the WordPress archive URL pattern?
I am using Valet+ for my Magento projects.
Currently I’m trying to add WP integration for M2 project. I put wordpress copy into pub/wp/ directory and want to go through the installation process, but I’m receiving 404 error when I’m trying to access url like https://magento2.test/wp/
Could anyone advice for it?
Thank you!
You can use custom valet driver for it.
Copy Magento2ValetDriver.php into magento root directory and rename it to LocalValetDriver.php
Also, change the class name to LocalValetDriver in it.
In the function frontControllerPath, add the following code at the top.
if ($uri === '/wp') {
$_SERVER['DOCUMENT_ROOT'] = $sitePath . '/pub/wp';
return $sitePath . '/pub/wp/index.php';
}
How can I get the root directory of my site? I want to use it as the src for <img>.
For example If I install the wordpress on www.mysite.com/blog/, the root is /blog.
But If I install it to www.mysite.com/test/blog, the root is /test/blog.
I tried to use the snippet from this question, but it returns the whole path as seen in FTP. So instead of returning just /blog, it returns /home/public_html/blog which won't work if used as src in image tag.
Any solution? Thanks.
You may use site_url() (eventually with echo) to get absolute path with server name and directory. Also, have a look at wordpress documentation about similar functions & what they provide.
You may have better luck over at the Wordpress Stack Exchange site :)
And this suggestion to use ABSPATH didn't help on that thread? https://stackoverflow.com/a/2356467/413254
site_url() return the path with http, in some cases, it is not allowed if the server turns off url inclusion. You can use the function below to get the root path of wordpress installation folder:
function get_wp_installation()
{
$full_path = getcwd();
$ar = explode("wp-", $full_path);
return $ar[0];
}
I was following this tutorial: http://www.xpertdeveloper.com/2011/07/wordpress-cookie-free-domain/
So, I created (CPANEL) the subdomain static.artswr.com and redirected it to artswr.com/wp-content/
I edited and add the following in the end of the wp-config file:
define("WP_CONTENT_URL", "http://static.artswr.com");
define("COOKIE_DOMAIN", "www.artswr.com");
I am loading everything with <?php bloginfo('template_directory'); ?> but its not working, also I'm getting 404 errors when I try to find a file in static.artswr.com
Instead of
define("WP_CONTENT_URL", "http://static.artswr.com");
Try
define("WP_CONTENT_URL", "http://static.artswr.com/wp-content");
without any redirections from your cpanel. static.artswr.com should point to artswr.com
check below line:
So, I created (CPANEL) the subdomain static.artswr.com and redirected it to artswr.com/wp-content/
You mentioned that you have redirected, but it should not be redirect, It should map to wp-content folder.
Let me know if any comments.
Here's what I'm trying to do:
joomla in 1 subdirectory, wordpress in another.
mysite.com directs to the joomla directory
mysite.com/blog gives wordpress.
I would also like to use seo friendly permalinks for both.
I am using Zeus Linux shared hosting with Joomla 1.5 and wordpress 2.9.2, and having a great deal of trouble finding a suitable rewrite script. Any help would be very much appreciated! Thank you.
The following should do the trick. It is based on the examples (pdf) document, and I haven’t tested it. The Zeus server development has stopped in 2010.
match URL into $ with ^blog/*$
if matched then
set URL = blog/index.php
endif
You would need something along the lines of the following
#Joomla
match URL into $ with (/content/|/component/)
if matched then set URL = /index.php
#Wordpress
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
# FIX FOR LOGIN
match URL into $ with ^/blog/wp-.*$
if matched then goto END
# FIX FOR SEARCH
match URL into $ with ^/blog/(.*)
set URL = /blog/index.php/$1