Custom content for front page in wordpress - wordpress

Is there any plugin available which I can use to post custom content on My front page?? I am using front page which has link to other blog pages. I want to put custom content on this front page but i am unable to find any plugin.
whatever plugins which i searched gives this facility for sidebar in a widget format there were no option for manually putting content in my theme.
Also is it possible to put latest post by a particular author on this page??

You need to edit index.php file in you're theme to do this . have a look at query_posts , what i would recomend is having a category called home_content and limit all the theme files using query_posts not to show that category , and show posts from that category only on the homepage ( index.php file from you're theme ) .
You could allso ask wordpress related questions on wordpress.stackexchange.com

Related

How to change the "/portfolio" slug from Wordpress?

My wordpress site has a portfolio page by itself, and the link is www.example.com/portfolio. I tried to find the specific page (with this url), but i couldn't find. So my purpose is to create a portfolio page, on my wordpress site and have the specific url "www.example.com/portfolio".
That where i did, to create a portfolio page, was to create a page and change the slug to "www.example.com/portfolio", but when i hit this url, show me the portfolio page, that has the site by itself and not my page.
So my question is, can i change the name of the existing url "/portfolio" and if yes, how (can i change it from my wordpress files), to appear the page i created and not existing page has the site by itself?
Thank you in advance!
Your WordPress page slugs aren't configured from within the codebase; instead if you go to the relevant page whilst in the admin dashboard, on the right hand side will be some config options - here is where you're able to change the slug.
How to change your slugs using permalinks WordPress Docs
It means you have a custom post type "portfolio". You need to unregister it. Put this code in the functions.php file of your active theme and then create a new page with a "portfolio" name(title).
if( !function_exists( 'cus_unregister_post_type' ) ) {
function cus_unregister_post_type(){
unregister_post_type( 'portfolio' );
}
}
add_action('init','cus_unregister_post_type');
Amin panel, go to pages... search for the page portfolio... there is no physical presence like portfolio.php... hope this helps
You just use this plugin and this plugin will help you.
Plugin: https://wordpress.org/plugins/custom-permalinks/

WordPress get posts to show on home.php

Is it possible to have the loop display posts on home.php? I want to have a static front page using front-page.php and then have the loop show posts on home.php. I put a link to home.php however, it is not showing posts and it is pulling up the index page as well. I thought home.php took precedence for showing blog posts. The only way I can get posts to show up on another page is by using the dashboard and setting reading preferences. Is there a way to avoid this so a user that downloads my theme won't have to change reading preferences for the theme to work as designed?
create a custom function for fetching post in the function.php file and then display it through shortcode in any home or front-page file.

Can the "Recent Posts Widget with Thumbnails" plugin in WordPress link to external URLs?

I am creating a WordPress site which has a menu on the home page, which was created with the plugin mentioned above. This menu is comprised of posts from my site, which should each link to an external URL.
The problem I'm having is that when I click on the post in the menu, it redirects me to the WordPress permalink, instead of the external URL I set for the post. Clicking on the posts on any other part of the site takes me to the external link, as I expected.
Any help would be much appreciated!
The plugin I am using: https://wordpress.org/plugins/recent-posts-widget-with-thumbnails/
The problem is that "Recent Posts Widget With Thumbnails" doesn't provide any way to overload the template used to display the widget. The permalink is displayed in includes/widget.php template (not overridable) on line 20:
?>><a href="<?php the_permalink(); ?>"<?php echo $link_target; ?>><?php
You have two options here:
Change that line to display the meta used by Themify to display the external link. This is not recommended because you won't be able to update the plugin (or if you do, it will break your modification) and this could end in a a possible security issue.
Just do what the plugin does yourself. It's not that difficult.
You'll just have to edit your home page template (front-page.php or index.php, depending of how you set Wordpress about this), and use get_posts to query the last posts:
$last_posts = get_posts('posts_per_page=5');
And display them using the_post_thumbnail for the thumbnails. You can use the template from the plugin and change it to your need.

WordPress which template for blog list? (If the layout for category.php is different and front-page.php is implemented)

On the WordPress site I'm creating, the latest blog post list and the category lists have different layouts.
I can use category.php for the list of posts in a category, but which template in the default WordPress hierarchy do I then use for the latest blog post listing?
I want to avoid custom page templates as far as possible.
(front-page.php is being used as the template for the static home page, so I can't use home.php, as per "Note: If front-page.php exists, it will override the home.php template." on this page:
https://developer.wordpress.org/themes/basics/template-hierarchy/)
The default template for the latest post is index.php.
I think you have set up a static page that us front-page.php template as front page in Settings -> Reading, isn't it? If yes, you can also set up a blog home page and that page will use the index.php template. Simply create a new page called for example "Blog", and set your Settings -> Reading like this:

how to change full posts to excerpt on inner blog page WordPress

in WordPress I have an inner page called "blog", and in settings->reading I have that page assigned as the page for blog posts. I want that page to be excerpt instead of full posts. In the theme page.php is used for the (page) loop for the Blog page, but that's overridden by the assignment of blogs posts to that page and I can't simply change "the_content" to "the_excerpt" in page.php to make this work.
I need some conditional tag code to this happen (or would that even work?) in page.php, or is there another way to accomplish this?
The Wordpress template hierarchy diagram will help you out - Wordpress Hierarchy
Your page.php template displays an individual page, it will not be generating the blog archive page you want to edit. Depending on your theme that will either be category.php, archive.php or index.php.
Just change the relevant file to change the excerpt on your blog page.

Resources