wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 163 forks source link

Permalink bug #168

Closed thomaslecoeur closed 8 years ago

thomaslecoeur commented 8 years ago

Hi,

I have a problem with permalink in the back office. I have weird code snippets like %3C instead of normal wordpress snippets.

In the permalink setting page :

image

In a post page :

image

Any idea where it could come from ?

Thanks !

Toddses commented 8 years ago

Hard to say with only this information. That %3C is the code for the < symbol, and %3E is >. To me, this looks like the URLs here all end with </code></td>. Seems like for some reason WP is interpreting those closing tags to be part of the URL, and not part of the HTML. What does the source look like on the permalink settings page?

thomaslecoeur commented 8 years ago

The code looks great in /wp-admin/options-permalink.php :

<tr>
  <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[2]); ?>" <?php checked($structures[2], $permalink_structure); ?> /> <?php _e('Month and name'); ?></label></th>
  <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
</tr>

(All html lines are the same, except the content)

Couldn't it be an encoding problem ? I'm using Wordpress in french.

Toddses commented 8 years ago

Take a look at the computed page source. In chrome, for instance, you can right-click a page and click View Page Source. Copy/Paste the relevant section.

thomaslecoeur commented 8 years ago

Seems to be because of the "home" wp option, wich is in my case //localhost:3000/myDir/www/ When I remove it from option-permalink.php it works normally.

Toddses commented 8 years ago

Cool. YeoPress doesn't handle a sub directory install without a bit of manual wp-config.php editing. You can change all the content/wordpress URLs in the YeoPress generated config. Just add in your subdirectory. For instance my home url looks like

define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . '/example/website');

and not

define('WP_HOME',    'http://' . $_SERVER['SERVER_NAME'] . '');