Xtheme - CDN - Logo - Revslider - rewritten issue

hi guys

i am using CDN for some of my sites and 2 of them have X the theme.
for some reasons,no matter what plugin i use to integrate CDN the logo and rev slider are not rewritten so they are not loading from CDN but from my server. all are cached on CDN but not rewritten.

is there any solution to fix that or is just wordpress… ?

thx

Hi There,

Thanks for writing in! Are you using CloudFlare CDN ? If so, the most common issue would be that if you have enabled autominification. Head over to CloudFlare account, Speed tab and then disable CSS & Javascript autominification options.

If you’re using any other CDN, provide us with more details so that we can assist you.

Thanks!

hi

i am using stackpath cdn. the test us done with webpagetest.org. what details u want me to provide ?
thx

Hi there,

Looks like you will have to contact the CDN provider, other CDN are able to manipulate URLs without changing the existing codes. Else, you will have to edit this file directly \framework\legacy\cranium\headers\views\global\_brand.php and change the logo URL accordingly, then copy that file to your child theme with the same folder structure to make sure the future update will overwrite it.

Thanks!

well , thats not gonna happen because i am not a coder and my time is busy with other things. anyway CDN bitch on wordpress and plugins , u guys tell me other CDN can do it without edinting theme code etc. if other CDN can do it then tell me that CDN provider please or a plug in that rewritte it better.

thank you

Hi there,

I recommend using CloudFlare, it doesn’t need to change the URLs as all requests will go through them and serve all your site’s asset files from CDN and cache it.

Thanks!

hi again.

after lots of talk and searches i found out there is plugin that can rewrite 100%.
cloudflare is not an option because of the price per site s i will stick with my actual cdn provider.

my problem is why 2 sites that use same theme X theme works different with CDN.

as example 1 serve logo from cdn and the other one from my own url.
cant understand that.
can u take a look at both sites ? will post them in a secure note.

thx

Hi there,

I am really not sure why this is happening to you. If you check the code of the file which is responsible for generating the logo it says:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>

As you can see in the code it uses the home_url() function which is the WordPress standard way of calling the URL which you set in Settings > General as your website home URL.

The only thing that I can suggest here is to install a Child Theme and copy the file:

wp-content/themes/x/framework/legacy/cranium/headers/views/global/_brand.php

and paste it to:

wp-content/themes/x-child/framework/legacy/cranium/headers/views/global/_brand.php

And change the code to:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>

<a href="CDN URL" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>

You will need to change CDN URL to the URL you want to have. If that is something that you can not do we can do it for you if you give us the FTP credentials:

FTP Server Address
FTP Username
FTP Password
FTP Port

You will need to give us the URL/User/Pass of your WordPress dashboard so that we can install the Child Theme for you.

Thank you.

the cild theme will broke anything on my website or is more limited ? if not,then i can provide everything you need

thx

Hi there.

It shouldn’t break, but switching to child theme could reset the menu and widgets. So you may re-assign the menu and widgets if that happens. Widgets are still available within inactive widgets sections so they are not really deleted.

Please install the child theme and implement the recommended change, then provide the FTP credentials so we could check it as well.

Thanks!

editing is not my thing, i am not a developer. i had to switch to cloudflare and everything is ok NOw.

this thread can be closed now.

thx

Glad you were able to resolve it :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.