Changeset 3037980
- Timestamp:
- 02/19/2024 01:38:50 PM (2 years ago)
- Location:
- makestories-helper/trunk
- Files:
-
- 14 edited
-
api/publish.php (modified) (4 diffs)
-
assets/js/ms-script.js (modified) (1 diff)
-
config.php (modified) (5 diffs)
-
helpers.php (modified) (3 diffs)
-
hooks.php (modified) (1 diff)
-
makestories.php (modified) (1 diff)
-
pages/index.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
-
shortcode.php (modified) (1 diff)
-
templates/editor.php (modified) (1 diff)
-
templates/listing-story-grid.php (modified) (2 diffs)
-
templates/listing-story-masonry.php (modified) (2 diffs)
-
templates/ms-single-masonry-post.php (modified) (2 diffs)
-
templates/ms-single-post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
makestories-helper/trunk/api/publish.php
r2943778 r3037980 1 1 <?php 2 add_action("wp_ajax_ms_publish_post", "ms_publish_post ");2 add_action("wp_ajax_ms_publish_post", "ms_publish_post_v2"); 3 3 4 4 /** … … 173 173 } 174 174 175 /** 176 * Action for publishing the post. Takes the story ID and gets the HTML for that 177 */ 178 function ms_publish_post_v2(){ 179 ms_protect_ajax_route(); 180 header("Content-Type: application/json"); 181 $options = ms_get_options(); 182 if((isset($_REQUEST["slug"]) || isset($_REQUEST["post_id"])) && isset($_REQUEST["story"])){ 183 $storyId = sanitize_text_field($_REQUEST["story"]); 184 185 //Create post if post_id is not present 186 //Get post permalink - to send while calling publishing 187 //Call publishing URL and publish it 188 // 189 $slug = sanitize_text_field($_REQUEST["slug"]); 190 if(isset($_REQUEST['post_id'])) { 191 $post = get_post((int)sanitize_text_field($_REQUEST['post_id'])); 192 if ($post && $post->post_status != 'trash') { 193 $post = $post->ID; 194 if(isset($_REQUEST["slides"])){ 195 $pages = sanitize_text_field($_REQUEST["slides"]); 196 update_post_meta($post,"pages", $pages); 197 } 198 } else { 199 die(json_encode(["success" => false, "error" => "Post already deleted!"])); 200 } 201 }else{ 202 203 //This is for scheduled stories 204 if (isset($_REQUEST["scheduleDate"])) { 205 //Handle story scheduling later 206 die(json_encode(["success" => false, "error" => "Scheduling not supported yet!"])); 207 } else { 208 $post = wp_insert_post([ 209 "post_content" => '', 210 "post_name" => $slug, 211 "post_title" => '', 212 "post_status" => "publish", 213 "post_type" => MS_POST_TYPE, 214 ]); 215 //todo: Update title 216 } 217 } 218 if(ms_is_categories_enabled() && !isset($_REQUEST['is_republish'])){ 219 $category = ms_get_default_category(); 220 if(isset($_REQUEST['category']) && !empty($_REQUEST['category'])){ 221 $category = sanitize_text_field($_REQUEST['category']); 222 } 223 wp_set_post_terms($post, $category, MS_TAXONOMY); 224 } 225 $link = get_post_permalink($post); 226 wp_update_post([ 227 // "post_content" => str_ireplace(MS_WORDPRESS_CANONICAL_SUBSTITUTION_PLACEHOLDER, $link, $html), 228 "post_content" => '', 229 "ID" => $post, 230 "post_name" => $slug, 231 ]); 232 update_post_meta( $post, "story_id", $storyId); 233 update_post_meta( $post, "version", 2); 234 235 $base = get_site_url() . "/" . ms_get_slug() . "/"; 236 $cleanedSlug = untrailingslashit(str_replace($base, "", $link)); 237 $response = wp_remote_post("http://apis-kub.makestories.io/publish/story",[ 238 "body" => json_encode([ 239 "storyId" => $storyId, 240 "slug" => $cleanedSlug, 241 "site_id" => $options['site_id'], 242 "uid" => sanitize_text_field($_REQUEST['userId']), 243 "token" => sanitize_text_field($_REQUEST['token']), 244 "workspace" => sanitize_text_field($_REQUEST['workspace']), 245 ]), 246 "headers" => [ 247 'Content-Type' => 'application/json', 248 ], 249 "timeout" => 120 250 ]); 251 if(is_wp_error($response)) { 252 wp_die(json_encode(["success" => false, "error" => "Some error occurred while publishing the story.!"])); 253 } 254 $parsed = json_decode($response['body'], true); 255 if($parsed && !$parsed['error'] && $parsed['url']){ 256 if(isset($parsed['publisherDetails'])){ 257 update_post_meta( $post, "publisher_details", json_encode($parsed['publisherDetails'])); 258 } 259 print_r( 260 json_encode( 261 getMSPostDataToSend( 262 get_post($post), 263 [ 264 "media" => [], 265 ] 266 ) 267 ) 268 ); 269 } else { 270 wp_die(json_encode([ 271 "success" => false, 272 "error" => $parsed["message"] ? $parsed["message"] : 'Some error occured' 273 ])); 274 } 275 wp_die(); 276 } 277 wp_die(json_encode(["success" => false, "error" => "Invalid details provided!"])); 278 } 279 175 280 add_action("wp_ajax_ms_upload_image_to_media_library", "ms_upload_image_to_media_library"); 176 281 add_action("wp_ajax_nopriv_ms_upload_image_to_media_library", "ms_upload_image_to_media_library"); … … 234 339 "post_id" => $post->ID, 235 340 "category" => $category, 341 "site_id" => $site_id, 236 342 ]; 237 343 } … … 299 405 "isPublished" => false, 300 406 ]; 407 $token = sanitize_text_field($_REQUEST['token']); 408 ms_verify_site_id($token); 301 409 if(isset($_REQUEST['story'])){ 302 410 $storyId = sanitize_text_field($_REQUEST['story']); -
makestories-helper/trunk/assets/js/ms-script.js
r2943817 r3037980 215 215 216 216 $('#ajax-posts').on('click', '.story-thumb-card', function(e){ 217 e.preventDefault(); 217 218 let elm = $(this); 218 219 let url = elm.attr('data-story-url'); -
makestories-helper/trunk/config.php
r2943817 r3037980 1 1 <?php 2 /**3 * Version of plugin in use4 */5 define("MS_PLUGIN_VERSION", "2.8");6 7 2 /** 8 3 * URL From where the main editor compiled files and other assets would be served 9 4 */ 10 define("MS_CDN_URL", "https://js.makestories.io/wp/".MS_PLUGIN_VERSION."/"); 5 define("MS_CDN_URL", "https://wpjs.makestories.io/3.0/dashboard/"); 6 define("MS_CDN_EDITOR_URL", "https://wpjs.makestories.io/3.0/editor/"); 11 7 12 8 /** … … 14 10 */ 15 11 define("MS_BASE_SERVER_URL", "https://server.makestories.io/"); 12 13 /** 14 * Base Story CDN url 15 */ 16 define("MS_STORY_CDN_URL", "https://wp-cdn.makestories.io/"); 16 17 17 18 /** … … 32 33 * Starting point of execution in the editor script s 33 34 */ 34 define("MS_MANIFEST_SCRIPT_URL", MS_CDN_URL."manifest.js"); 35 define("MS_MAIN_SCRIPT_URL", MS_CDN_URL."chunks/index.js"); 36 define("MS_VENDOR_SCRIPT_URL", MS_CDN_URL."chunks/vendor.js"); 35 define("MS_MAIN_SCRIPT_URL", MS_CDN_EDITOR_URL."static/main.js"); 36 define("MS_MAIN_STYLE_URL", MS_CDN_EDITOR_URL."static/css/main.css"); 37 define("MS_VENDOR_SCRIPT_URL", MS_CDN_EDITOR_URL."static/chunks/vendors.js"); 38 define("MS_VENDOR_STYLE_URL", MS_CDN_EDITOR_URL."static/css/vendors.css"); 39 40 41 define("MS_DASHBOARD_MAIN_SCRIPT_URL", MS_CDN_URL."index.js"); 37 42 38 43 /** … … 66 71 "icon" => "dashicons-schedule" 67 72 ], 73 "DASHBOARD" => [ 74 "slug" => "makestories-dashboard", 75 "icon" => "dashicons-schedule" 76 ], 68 77 "Published" =>[ 69 78 "slug"=>"published_stories_slug" … … 75 84 "categories_enabled" => false, 76 85 "to_rewrite" => false, 86 "site_id" => false, 77 87 "forceUploadMedia" => false, 78 88 "default_category" => "Uncategorized", -
makestories-helper/trunk/helpers.php
r2943817 r3037980 26 26 return $html; 27 27 } 28 function ms_get_story_cdn_url($slug){ 29 $site_id = ms_get_options()['site_id']; 30 return MS_STORY_CDN_URL.$site_id."/".$slug."/"; 31 } 32 /** 33 * Function to get built HTML content from CDN given the slug. 34 * @param $slug string 35 * @return bool|string 36 */ 37 function ms_get_story_HTML_v2($slug){ 38 $url = ms_get_story_cdn_url($slug); 39 $response = wp_remote_get($url); 40 $html = $response['body']; 41 return $html; 42 } 28 43 29 44 function msEndsWith( $haystack, $needle ) { … … 37 52 $options = get_option('mscpt_makestories_settings'); 38 53 $defaults = MS_DEFAULT_OPTIONS; 54 if (!$options || !is_array($options)) { 55 $options = []; 56 } 39 57 if($options && is_array($options)){ 40 58 foreach ($defaults as $key => $value){ … … 130 148 return $cat; 131 149 } 150 151 function ms_verify_site_id($token){ 152 $options = ms_get_options(); 153 if(isset($options['site_id']) && $options['site_id']){ 154 return $options['site_id']; 155 } 156 $response = wp_remote_post("https://api.makestories.io/hosting/get-wp-site",[ 157 "body" => json_encode([ 158 "slug" => ms_get_slug(), 159 "domain" => get_site_url(""), 160 "token" => sanitize_text_field($token), 161 ]), 162 "headers" => [ 163 'Content-Type' => 'application/json', 164 ], 165 "timeout" => 120 166 ]); 167 $parsed = json_decode($response['body'], true); 168 if($parsed && $parsed['success'] && $parsed['site_id']){ 169 $options['site_id'] = $parsed['site_id']; 170 update_option('mscpt_makestories_settings',$options); 171 return $options['site_id']; 172 } 173 wp_die(json_encode(["success" => false, "error" => "Some error occurred while getting Site Id.!"])); 174 } -
makestories-helper/trunk/hooks.php
r2943778 r3037980 122 122 if ($post && $post->post_type == MS_POST_TYPE && is_singular(MS_POST_TYPE)) { 123 123 //If it is a story, then show the story html 124 print_r(apply_filters("ms_story_html", $post->post_content)); 124 $version = get_post_meta( $post->ID, "version", true); 125 if($version == 2){ 126 $html = ms_get_story_HTML_v2($post->post_name); 127 $url = ms_get_story_cdn_url($post->post_name); 128 $html = preg_replace("/([\'\"])(assets\/)/",'$1'.$url.'$2',$html); 129 if($html){ 130 print_r(apply_filters("ms_story_html", $html)); 131 }else{ 132 //Fallback to older version if exists 133 print_r(apply_filters("ms_story_html", $post->post_content)); 134 } 135 }else{ 136 print_r(apply_filters("ms_story_html", $post->post_content)); 137 } 125 138 die(); 126 139 } -
makestories-helper/trunk/makestories.php
r3009211 r3037980 4 4 Plugin URI: https://makestories.io/official-wordpress-webstories-plugin/ 5 5 Description: The leading Google Web Stories Editor is now available to create Stories in WordPress. It is easy to use, allows for extensive customization, and is adaptive for future changes. 6 Version: 2.8.26 Version: 3.0.0 7 7 Author: MakeStories Team 8 8 Author URI: https://makestories.io -
makestories-helper/trunk/pages/index.php
r2724522 r3037980 6 6 if(current_user_can($role) && !$alreadyAdded){ 7 7 $alreadyAdded = true; 8 add_dashboard_page( 9 __( 'MakeStories', MS_TEXT_DOMAIN ), 10 __( 'MakeStories', MS_TEXT_DOMAIN ), 11 $role, 12 MS_ROUTING['EDITOR']['slug'], 13 'ms_editor_contents', 14 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9IiNhMGE1YWEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2EwYTVhYSIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTguMjEwOSAzLjE2ODNDMTkuMTAwMSA0LjI3MTg2IDE5LjcwNDcgNS41NTM0MiAxOS45MTgxIDcuMDEyOThDMjAuNDg3MiAxMC45NjQ1IDE3Ljk5NzUgMTQuNTU5OSAxNS4yOTQzIDE2LjI2ODdDMTQuNDQwNyAxNi44MzgzIDEwLjMxNDggMTkuMTg3OCA3Ljg5NjEzIDE5LjE4NzhDNy41MDQ4OSAxOS4xODc4IDcuMTQ5MjEgMTkuMTE2NiA2Ljg2NDY2IDE4Ljk3NDJMNi45MTYyNyAxOC45MTU3TDYuODI5MjcgMTkuMDA5NUM2LjcyMjU3IDE4Ljk3MzkgNi42NTE0MyAxOC45MzgzIDYuNTgwMyAxOC44NjcxQzYuMzMxMzIgMTguNjg5MSA1LjgzMzM3IDE4LjA4NCA2LjI5NTc1IDE3LjAxNkw2LjM2Njg5IDE2Ljg3MzZMOC44OTIyMiAxNC4wOTY5SDExLjA5NzRDMTEuMDI2MyAxNC4zNDYxIDEwLjg4NCAxNC41Mj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i4wOTgzNSA0LjE2NTM4IDEuNzQyNjcgNC41NTY5NyAxLjc0MjY3IDUuMDE5NzVDMS43NDI2NyA1LjQ4MjU0IDIuMTMzOTIgNS44NzQxMyAyLjU5NjMgNS44NzQxM0gxMS4zNDZDMTEuODA4NCA1Ljg3NDEzIDEyLjE5OTcgNS40ODI1NCAxMi4xOTk3IDUuMDE5NzVaTTEwLjIwOCA4LjI1OTE2QzEwLjY3MDQgOC4yNTkxNiAxMS4wNjE3IDguNjE1MTUgMTEuMDYxNyA5LjExMzUzQzExLjA2MTcgOS42MTE5MSAxMC42NzA0IDEwLjAwMzUgMTAuMjA4IDkuOTY3OUgwLjg1MzYzNEMwLjM5MTI0OSA5Ljk2NzkgMCA5LjYxMTkxIDAgOS4xMTM1M0MwIDguNjUwNzQgMC4zNTU2ODEgOC4yNTkxNiAwLjg1MzYzNCA4LjI1OTE2SDEwLjIwOFoiLz4KPC9zdmc+Cg==' 15 ); 8 16 add_menu_page( 9 17 __( 'MakeStories', MS_TEXT_DOMAIN ), 10 18 __( 'MakeStories', MS_TEXT_DOMAIN ), 11 19 $role, 12 MS_ROUTING[' EDITOR']['slug'],20 MS_ROUTING['DASHBOARD']['slug'], 13 21 'ms_editor_contents', 14 22 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9IiNhMGE1YWEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2EwYTVhYSIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTguMjEwOSAzLjE2ODNDMTkuMTAwMSA0LjI3MTg2IDE5LjcwNDcgNS41NTM0MiAxOS45MTgxIDcuMDEyOThDMjAuNDg3MiAxMC45NjQ1IDE3Ljk5NzUgMTQuNTU5OSAxNS4yOTQzIDE2LjI2ODdDMTQuNDQwNyAxNi44MzgzIDEwLjMxNDggMTkuMTg3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MjkgOS44NTIwMyAxMi4zNTI5SDMuNDQ5NzhDMi45NTE4MyAxMi4zNTI5IDIuNTk2MTUgMTIuNzQ0NSAyLjU5NjE1IDEzLjIwNzNDMi41OTYxNSAxMy42NzAxIDIuOTg3MzkgMTQuMDYxNyAzLjQ0OTc4IDE0LjA2MTdIOC45MjcyNkgxMS4xMzI1QzExLjIwMzYgMTMuODQ4MSAxMS4yMzkyIDEzLjU2MzMgMTEuMTMyNSAxMy4yNzg1Wk0xMi4xOTk3IDUuMDE5NzVDMTIuMTk5NyA0LjUyMTM3IDExLjgwODQgNC4xNjUzOCAxMS4zNDYgNC4xNjUzOEgyLjU5NjNDMi4wOTgzNSA0LjE2NTM4IDEuNzQyNjcgNC41NTY5NyAxLjc0MjY3IDUuMDE5NzVDMS43NDI2NyA1LjQ4MjU0IDIuMTMzOTIgNS44NzQxMyAyLjU5NjMgNS44NzQxM0gxMS4zNDZDMTEuODA4NCA1Ljg3NDEzIDEyLjE5OTcgNS40ODI1NCAxMi4xOTk3IDUuMDE5NzVaTTEwLjIwOCA4LjI1OTE2QzEwLjY3MDQgOC4yNTkxNiAxMS4wNjE3IDguNjE1MTUgMTEuMDYxNyA5LjExMzUzQzExLjA2MTcgOS42MTE5MSAxMC42NzA0IDEwLjAwMzUgMTAuMjA4IDkuOTY3OUgwLjg1MzYzNEMwLjM5MTI0OSA5Ljk2NzkgMCA5LjYxMTkxIDAgOS4xMTM1M0MwIDguNjUwNzQgMC4zNTU2ODEgOC4yNTkxNiAwLjg1MzYzNCA4LjI1OTE2SDEwLjIwOFoiLz4KPC9zdmc+Cg==' … … 35 43 $alreadyAdded = true; 36 44 add_submenu_page( 37 MS_ROUTING[' EDITOR']['slug'],38 'Settings', 39 'Settings', 40 $role, 41 'ms_settings', 42 'ms_option_page' 45 MS_ROUTING['DASHBOARD']['slug'], //Parent Slug 46 'Settings', //Page Title 47 'Settings', //Menu Title 48 $role, //Capability 49 'ms_settings', //menu_slug 50 'ms_option_page' //callback 43 51 ); 44 52 if(ms_is_categories_enabled()){ 45 53 $permalink = admin_url("edit-tags.php?taxonomy=ms_story_category"); 46 $submenu[MS_ROUTING[' EDITOR']['slug']][] = array( 'Categories', $role, $permalink );54 $submenu[MS_ROUTING['DASHBOARD']['slug']][] = array( 'Categories', $role, $permalink ); 47 55 } 48 56 $permalink = admin_url("edit.php?post_type=makestories_story"); 49 $submenu[MS_ROUTING[' EDITOR']['slug']][] = array( 'Published Stories', $role, $permalink );57 $submenu[MS_ROUTING['DASHBOARD']['slug']][] = array( 'Published Stories', $role, $permalink ); 50 58 } 51 59 } … … 85 93 if(is_admin() && isset($_GET['page'])){ 86 94 $pagenow = sanitize_text_field($_GET['page']); 87 if($pagenow === MS_ROUTING['EDITOR']['slug'] ){95 if($pagenow === MS_ROUTING['EDITOR']['slug'] || $pagenow === MS_ROUTING['DASHBOARD']['slug']){ 88 96 return $classes." folded"; 89 97 } … … 96 104 if(is_admin() && isset($_GET['page'])){ 97 105 $pagenow = sanitize_text_field($_GET['page']); 98 return $pagenow === MS_ROUTING['EDITOR']['slug']; 106 return $pagenow === MS_ROUTING['EDITOR']['slug'] || $pagenow === MS_ROUTING['DASHBOARD']['slug']; 107 } 108 return false; 109 } 110 function isMSDashboardPage(){ 111 if(is_admin() && isset($_GET['page'])){ 112 $pagenow = sanitize_text_field($_GET['page']); 113 return $pagenow === MS_ROUTING['DASHBOARD']['slug']; 99 114 } 100 115 return false; … … 110 125 111 126 function ms_editor_footer(){ 112 if(isMS EditorPage()){127 if(isMSDashboardPage()){ 113 128 require_once(MS_PLUGIN_BASE_PATH."/templates/editor-footer.php"); 114 wp_enqueue_script("ms_manifest_script_url", MS_MANIFEST_SCRIPT_URL, [], false, true); 129 wp_enqueue_script("ms_main_script_url", MS_DASHBOARD_MAIN_SCRIPT_URL, [], false, true); 130 } else if(isMSEditorPage()){ 131 require_once(MS_PLUGIN_BASE_PATH."/templates/editor-footer.php"); 115 132 wp_enqueue_script("ms_vendor_script_url", MS_VENDOR_SCRIPT_URL, [], false, true); 116 133 wp_enqueue_script("ms_main_script_url", MS_MAIN_SCRIPT_URL, [], false, true); 134 wp_enqueue_style("ms_font_style_url", "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700& display=swap"); 135 wp_enqueue_style("ms_main_style_url", MS_MAIN_STYLE_URL); 136 wp_enqueue_style("ms_vendor_style_url", MS_VENDOR_STYLE_URL); 117 137 } 118 138 } -
makestories-helper/trunk/readme.txt
r3007902 r3037980 3 3 Tags: amp-story, makestories, stories, web stories, amp, storytelling 4 4 Requires at least: 4.0 5 Tested up to: 6.4. 26 Stable tag: 2.8.15 Tested up to: 6.4.3 6 Stable tag: 3.0.0 7 7 Requires PHP: 5.6 8 8 -
makestories-helper/trunk/shortcode.php
r2943778 r3037980 103 103 */ 104 104 add_shortcode( 'ms_get_single_post', 'ms_get_single_post_via_shortcode' ); 105 add_shortcode( 'ms_get_single_post_shortcode', 'ms_get_single_post_via_shortcode' ); 106 add_shortcode( 'ms_get_single_post_via_shortcode', 'ms_get_single_post_via_shortcode' ); 105 107 106 108 function ms_get_single_post_via_shortcode($attr) { -
makestories-helper/trunk/templates/editor.php
r2943778 r3037980 3 3 <script> 4 4 <?php 5 $ slug = get_option('mscpt_makestories_settings');5 $options = ms_get_options(); 6 6 $baseUrl = get_site_url(); 7 if (!empty($ slug) && isset($slug['post_slug'])) {8 $baseUrl = trailingslashit($baseUrl) . trailingslashit($ slug['post_slug']);7 if (!empty($options) && isset($options['post_slug'])) { 8 $baseUrl = trailingslashit($baseUrl) . trailingslashit($options['post_slug']); 9 9 } 10 10 $user = wp_get_current_user(); -
makestories-helper/trunk/templates/listing-story-grid.php
r2943778 r3037980 15 15 } 16 16 ?> 17 < div class="single-story-col" data-story-url="<?php echo esc_attr($permalink); ?>">17 <a class="single-story-col" data-story-url="<?php echo $permalink; ?>" href="<?php echo $permalink; ?>"> 18 18 <div class="single-story"> 19 19 <div class="background-cards"> … … 39 39 </div> 40 40 </div> 41 </ div>41 </a> 42 42 <!-- new UI end --> 43 43 <?php -
makestories-helper/trunk/templates/listing-story-masonry.php
r2943778 r3037980 15 15 } 16 16 ?> 17 < div class="story-thumb-card card <?php echo $getClassNames[$index]; ?>" data-story-url="<?php echo $permalink; ?>">17 <a class="story-thumb-card card <?php echo $getClassNames[$index]; ?>" data-story-url="<?php echo $permalink; ?>" href="<?php echo $permalink; ?>"> 18 18 <div class="cardin"> 19 19 <div class="cardimage"> … … 43 43 </div> 44 44 </div> 45 </ div>45 </a> 46 46 <?php 47 47 -
makestories-helper/trunk/templates/ms-single-masonry-post.php
r2943778 r3037980 1 1 <?php $index = 0; ?> 2 2 <div class="design-1"> 3 < div class="story-thumb-card card bigmiddleStory" data-story-url="<?php echo $permalink; ?>">3 <a class="story-thumb-card card bigmiddleStory" data-story-url="<?php echo $permalink; ?>" href="<?php echo $permalink; ?>"> 4 4 <div class="cardin"> 5 5 <div class="cardimage"> … … 29 29 </div> 30 30 </div> 31 </a> 31 32 </div> 32 </div> -
makestories-helper/trunk/templates/ms-single-post.php
r2943778 r3037980 1 1 <?php $index = 0; ?> 2 < div class="single-story-col" id="single-story" data-story-url="<?php echo esc_attr($permalink); ?>">2 <a class="single-story-col" id="single-story" data-story-url="<?php echo $permalink; ?>" href="<?php echo $permalink; ?>"> 3 3 <div class="single-story"> 4 4 <div class="background-cards"> … … 24 24 </div> 25 25 </div> 26 </ div>26 </a>
Note: See TracChangeset
for help on using the changeset viewer.