Skip to content

Commit 0176dcc

Browse files
Roy SivanRoy Sivan
authored andcommitted
adding in router handling of subdirectory
1 parent be3646f commit 0176dcc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

build/js/react_app_js.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ var Post = React.createClass({
77
dangerouslySetInnerHTML: {
88
__html: this.props.content
99
}
10-
}), React.createElement("a", {
11-
href: '/#/post/' + this.props.ID,
10+
}),
11+
React.createElement("a", {
12+
href: ajaxInfo.site_url + '/#/post/' + this.props.ID,
1213
className: 'btn btn-success'
13-
}, 'View Post'), React.createElement("button", {
14+
}, 'View Post'),
15+
React.createElement("button", {
1416
onClick: this.editPost,
1517
"data-id": this.props.ID,
1618
className: "edit_post btn btn-primary"

functions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function __react_ang_scripts() {
1515
array(
1616
'json_url' => get_bloginfo('wpurl').'/wp-json/',
1717
'nonce' => wp_create_nonce( 'wp_json' ),
18-
'template_directory' => get_template_directory_uri()
18+
'template_directory' => get_template_directory_uri(),
19+
'site_url' => get_bloginfo('wpurl')
1920
)
2021
);
2122

0 commit comments

Comments
 (0)