Wordpress setting custom Frontpage - wordpress

how can I make a link that is coming from a plugin the frontpage
ex: /wp-content/plugins/documente/documentations/medias_v4/index.html
or
ex: /?p=5

In your active theme, make a file called front-page.php or edit an existing one. In it, add a line in the beginning: <?php include '/wp-content/plugins/documente/documentations/medias_v4/index.html'; exit; ?>

Related

Add Shortcode to All Post Types

I want to display shortcodes (I'm using fruitful Shortcode) above the post title tag (H1). And I want to display it to all my post (also as a template).
i want to be like this
Thanks.
If you want to adjust the way your single posts are displayed for all the posts, you have to edit the single.php file in your theme folder. You can do this in the backend under "Design" -> "Theme Editor" or you can access the folder and files via FTP.
For your default posts in wordpress you just need to open the single.php file and look for the h1 with your title. It can look something like:
<h1><?php the_title(); ?></h1>
Above that (if you want to display it above), you can put your shortcode with the do_shortcode() function:
<?php echo do_shortcode('[name_of_shortcode]'); ?>
If you are not using normal posts of wordpress but custom post types or something else, please have a look at the wordpress template hierarchy to find out, which file to edit or how to name the new files for creating template files: https://developer.wordpress.org/themes/basics/template-hierarchy/
If you are using a theme that is not made by you, you should make sure you keep your theme updateable. So if you overwrite the single.php, with the next update of your theme, the file will not have your edits. You need a child theme, if you want to keep your parent theme up to date but also customize it in the page templates. Here is a nice tutorial for child themes: https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/

Show all post content on Wordpress

Im using the theme HTML 5 Blank (http://html5blank.com/) with WordPress 3.7.1.
On my page I want to display everthing from the posts, text and images.
In the settings in wordpress admin i have it set on show hole post but it does not work.
I have olso deleted the php code in the loop that inserts the excerpt from the theme. Sitt not workning. Any ideas? I can send code if you want, for now i do not know what code can be usefull.
Jim
Replace <?php the_excerpt() ?>and add the following code to your theme's loop.
<?php the_content(); ?>
That should display the content, rather that the excerpt.

How to change header in Wordpress Blog page and all Post pages only

How to change header in Wordpress Blog page and all Post pages only.
I want a custom header in Blog page and all single posts page.
Thanks
You can use conditional tags within Wordpress:
http://codex.wordpress.org/Conditional_Tags
Basically, you will need to create the content you want only for the blog and post pages and wrap this within the conditional tags:
P.S Don't forget to include the category, and archive pages - as well as the post pages.
is_single(), is_archive(), is_category()
<?php if (is_single()) { ?>
// This is a post page
<?php } else { ?>
//This is not a post page
<?php } ?>
Hope this helps.
To include different header for specific pages change get_header($name) function call inside templates and add $name attribute. Wordpress will load header-{name}.php if file exists, if not, default header header.php will be loaded. Check out template hierarchy for templates where you need to change get_header() function call ( single.php, page.php ).
Wordpress documentation:
get_header
template hierarchy

How to add comments to a WordPress theme

How can I add comments to my WordPress theme. I tried <?php comment_form(); ?> but it doesn't give any output. Am I missing something?
Just add the following line
<?php comments_template(); ?>
inside your single.php where you want to add/display the comments template. This will add/include the comments.php file in the single template and make sure that comments.php is also available in your theme folder.
Also you can use Disqus wordpress plugin, it's a very nice plugin.
References: Codex and a tutorial.

How to include a Wordpress Shortcode in your Code, not in the Posts Section

I want to insert a hardcoded short code in my code, and not from the usual Text Editor we usually use.
Basically I want this to add a gallery, and the user doesn't need to change the shortcode from the CMS so I will be hardcoding this.
How would I need to do this, I tried to just post it in my .php file but it doesn't work.
This is the code I want to add:
[jj-ngg-jquery-slider gallery="1" width="866" height="341" ]
This will do the trick to include in .php files:
<?php echo do_shortcode('[jj-ngg-jquery-slider gallery="1" width="866" height="341"]'); ?>
shortcodes were created to include in post or pages. I could be wrong but wordpress checks the input of a post and if it finds a shortcode it will replace it with the html. I don't think it will work if you add shortcodes in your .php file because wordpress doesn't look for shortcodes in your php files
You could just create a function in functions.php to generate the html you need. Then you just call that function within your theme .php file. That's how most plugins are made. Shortcode for post & pages and function in the php files.
example:
<?php echo myGallery(array('gallery'=>1, 'width'=>866, 'height' => 341); ?>
Did you try this method ? do_shortcode($content)
I've seen it on http://codex.wordpress.org/Shortcode_API

Resources