How to disabling auto embed in wordpress? - wordpress

I need to put a youtube playlist in a href, belong the code I'm using :
here
but the link is automatically embed in my post page, what should I do to display something like that : ' here (with youtube playlist urls ):

WordPress automatically adds a filter to embed the videos. All you have to do is removing this filter with the following line (in a plugin or in the functions.php file of your theme): remove_filter('the_content', array($GLOBALS['wp_embed'], 'autoembed'), 8);.
(source)

Related

Hide Shortcodes From Wordpress RSS Feed

I added Adsense to my content via shortcodes. But Adsense codes appears in RSS too. How can I hide shortcodes from RSS Feed and show only for in posts ?
I am using sahifa wordpress theme.
You will need to alter how the RSS is output.
All the RSS styling files are located in the wp-includes folder and are titled as follows:
feed-rss2.php
feed-rss.php
feed-rdf.php
feed-atom.php
feed-atom-comments.php
feed-rss2-comments.php
Then within these files, you need to find where it calls the function the_excerpt_rss(). This calls out the content in excerpt format.
You will need to enclose this in a function called strip_shortcodes().
As an example from feed-atom.php line 70:
<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php strip_shortcodes(the_excerpt_rss()); ?>]]></summary>
Hope this helps

How do I edit HTML on WordPress post page?

I'm using WordPress and I've made a number of posts. What file do I need to edit, so the same HTML shows on the bottom of all the posts?
there are so many file wordpress theme structure if you want to edit:
(i think you Edit single.php)
page.php : use for simple page
index.php : use for post page
single.php : use for single post if you want to change ur post setting
similerly footer.php, header.php
The default name of the template file used to display pages in Wordpress is named page.php. It is located in your current theme.

Insert a google map in a Wordpress page

I'm new to wordpress and am trying to insert a Google map in a page.
I found tutorials for including a map using the "link" functionality on maps.google, but I want to load specific markers, defined in an xml file.
Do I need a plugin to do that ?
what you could do is create a page template file for your custom code..
ie:
make a copy of page.php open it up in your editor, and paste this at the top of the page before the get_header;
<?php
/*
Template Name: CustomMapPage
*/
?>
then after you do this & upload it, go back to your wordpress admin, the page you are trying to add the map to (reload/refresh that page) and on the right sidebar select from teh dropdown for template and assign it the value of 'CustomMapPage' then update your page,
Now your using a page template in which you can add code to, which will generate your map,
in your template page add your google api key and any other javascript files you need,
then following a tutorial like this or a plugin like this

Embedding Wordfaire into Self Hosted Wordpress

I am trying to get Wordfaire live blogging embed code to work on my site and having some problems. I created a new page for my live blog feed on site site and added the embed code to the html page in wordpress. When I test it out and try a test live blog nothing runs on the page.
Is there a trick to getting it to work on wordpress??
Thanks in advance to anyone that can assist!
It sounds to me that you are using the HTML view of the WordPress editor to paste the embed code, correct?
A better way would be to make a simple plugin that will create a shortcode with the embed code, then you use that shortcode to display the embed code on your page.
Example:
embed-shortcode-plugin.php
<?php
/*
Plugin Name: Plugin Name
Plugin URI: http://pluginurl.com
Description: Plugin description
Version: 1.0
Author: Author Name
Author URI: http://authorurl.com
*/
function embed_shortcode($atts,$content=null){
extract(shortcode_atts(array('optionname'=>'defaultvalue'),$atts));
// The extract() function above will allow you to do [shortcode optionname="defaultvalue"] in your pages and use $optionname to get the value below
// The extract() line is optional and can be removed
// $optionname = defaultvalue
return 'put your embed code here';
}
add_shortcode('shortcode','embed_shortcode');
// This will add the shortcode 'shortcode': [shortcode], change to whatever
?>
Put that in your plugins folder and then activate it. Alternatively, you could remove the stuff between the /* and */ and put that code right in your theme's functions.php file and it will run the same.

How do I create a custom WordPress page?

I want my WordPress blog to have a page called music. On that page I will query the DB for posts with the category music and then change around the look and feel of the posts. So I can't just put a link to /categories/music/ because I want to do custom work on the posts.
Should I put this code in a separate php file and link to it? I think I may lose access to all the nice WordPress API calls if I do that.
I was thinking about using a filter, but I am not sure which one to use. I was thinking something like the following except the_title has not been grabbed yet so I cannot check the title.
function show_music(){
if( is_page() && the_title('','',false) == 'music' ){
echo "got here";
}
}
add_filter('pre_get_posts', 'show_portfolio');
How would you go about this?
You need to put the below code in the file, and then put the file in the Theme folder. Then you can create a page using Wordpress pages and select a page template with the name you put in this comment:
/*
Template Name: Something Goes Here
*/
You need to create custom page within your theme. If you dont have idea how to create custme page or template page in WordPress theme then view my easy tutorial How to create template page in WordPress

Resources