Search Redirect to wrong Page - silverstripe

Working with SilverStripe I am trying to add search to my website. I have created my own theme, which I am using in my project. Now I am trying to add search in the blog.
In my Page.ss I have added this
<div class="search">
<h3>SEARCH HERE</h3>
$SearchForm
</div>
This code is for adding a search box in the website.
In the config I enable this
FulltextSearchable::enable();
The problem is that it is redirecting me to old theme search page instead of my own theme.

Related

IFTTT to WordPress issue

I'm using IFTTT to post new YouTube videos automatically to WordPress. Every time I upload new video, a new WP post should be generated with this HTML code:
[vc_row row_height_percent="0" overlay_color="color-396201"
overlay_alpha="100" gutter_size="3" column_width_percent="100"
shift_y="0" z_index="0"][vc_column width="1/1"][vc_column_text]
<div class="responsive-video">
https://youtu.be/"videoID"
</div>
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/1"]
[uncode_block id="67020"][/vc_column][/vc_row]
When IFTTT posts this on WordPress, it works! BUT: IFTTT does not post the correct code - instead it posts this:
[vc_row row_height_percent="0" overlay_color="color-396201"
overlay_alpha="100" gutter_size="3" column_width_percent="100"
shift_y="0" z_index="0"][vc_column width="1/1"][vc_column_text]
<div class="responsive-video">https://youtu.be/"videoID"</div>
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/1"]
[uncode_block id="67020"][/vc_column][/vc_row]
So IFTTT posts the code without those "spaces" before/after the video URL. And because of that WordPress doesn't automatically embed the video. (It doesn't recognize the URL as a video without those spaces... So on the post the video URL is displayed just as a normal text.
Any idea how to tell IFTTT to keep those "spaces" in the code, so WordPress embeds the video?
if you can put <br> for in between spaces
[vc_row row_height_percent="0" overlay_color="color-396201"
overlay_alpha="100" gutter_size="3" column_width_percent="100"
shift_y="0" z_index="0"][vc_column width="1/1"][vc_column_text]
<div class="responsive-video">
https://youtu.be/"videoID"
</div>
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/1"]
[uncode_block id="67020"][/vc_column][/vc_row]

generate a pdf in wordpress without using the plugin

I am a wordpress developer. I am stuck here with I need to generate a pdf in wordpress without plugin so just let me know how?
<div class="abccenter">
<button class="red_bt margin40">Download PDF</button>
</div>
<div class="abcpostwrapper margintop20">
<div class="abcpostcontent">
on this download button?
You can easily create pdf via MPDF (http://www.mpdf1.com/mpdf/index.php) with simple integeration.

Ckeditor for wordpress on custom admin page

I have the plugin CKEditor for Wordpress installed and want to show a CKEditor on a custom admin page I made. I use the wordpress function wp_editor() to show it.
wp_editor("initial content", "uniqueid");
The problem is it shows a completely white editor instead of the CKEditor (so: a large white rectangle with a HTML and Visual above). It produces the following html on my page (I left out the "HTML" and "Add Media" button):
<div id="wp-uniqueid-wrap" class="wp-editor-wrap tmce-active"><link rel="stylesheet" id="editor-buttons-css" href="/wp-includes/css/editor.min.css?ver=4.1.1" type="text/css" media="all">
<div id="wp-uniqueid-editor-tools" class="wp-editor-tools">
<a id="uniqueid-tmce" class="hide-if-no-js wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">Visual</a>
</div>
<div id="wp-uniqueid-editor-container" class="wp-editor-container">
<textarea class="wp-editor-area theEditor" rows="10" cols="40" name="uniqueid" id="uniqueid"><p>initial content</p></textarea>
</div>
</div>
Only when I click the "Visual" tab I get the CKEditor. Only then does it look exactly like the one in my regular admin pages (Posts and Pages).
So, my question is what should I add to my custom admin page or to my custom functions to have the CKEditor appear on a custom admin page like it appears on the "edit post" and "edit page" pages, without the user having to click the Visual tab to show the editor and its content?
Or, the other way around, which code is added to the regular "edit post" and "edit page" pages in order for the CKEditor to show up normally?
EDIT:
I managed to get it work partly. There is still something bugging me.
I added the following after the wp_editor() call:
<script>
window.onload = function(){
CKEDITOR.replace( "uniqueid" );
};
</script>
Now I see the editor.
I had the same issue with wp_editor() not displaying multiple TinyMCE editors on custom fields in Wordpress, as they all had the same class - so I added both 'wp_create_nonce($name)' and 'wp_create_nonce($this->id)'
<?php wp_editor($value, 'editor-'. wp_create_nonce($name) . wp_create_nonce($this->id) .'', $settings = array('textarea_name' => $name)); ?>
The nonce is generated based on the current time, the $action argument, and the current user ID.

Per widget on sidebar, output custom html with widget content

I'm new to WordPress and it's all complicated to me, but a client has asked I design a WordPress compatible theme for him from the given theme. I've got most of the bits and bobs done but I still don't understand how I'd get wordpress to output custom html in the way I wish... For example, I have this code here which is to be a "widget" on the sidebar, however I can't find out how I'd get wordpress to output a code similar to this so that it'd be compatible with the theme..
<div class="panelfive" id="panel3">
<h4>WIDGET NAME</h4>
<div id="panel2-body" class="panel_body">
<ul>
WIDGET CONTENT
</ul>
</div>
</div>
Usually themes will have a sidebar.php or similar, but it's not really necessary unless you want to make it modular. A wordpress theme is really just PHP, so you can throw that HTML in page.php and it will load anytime a page is loaded.
Check out a couple of references:
General reference for theme development--many pages and sub-pages: http://codex.wordpress.org/Theme_Development
A visual representation of what a wordpress theme looks like, and the related files: http://yoast.com/wordpress-theme-anatomy/

Facebook like button on Wordpress

I added a like button to my index.php and single.php on yssencial.com (using wordpress)
but on the main page (index.php) it is not sharing the article but the site url (www.yssencial.com) instead.
You need to set the data-href property of the individual posts to your posts url. Otherwise it will use the page that it is actually on, eg your home page.
<div class="fb-like" data-href="http://www.yssencial.com/2011/09/20/terra-nova-quando-o-parque-jurassico-encontra-a-maquina-do-tempo/" data-send="false" data-layout="button_count" data-width="140" data-show-faces="true"></div>

Resources