Wordpress full post showing - wordpress

When I am posting something on wordpress, it is showing the full post. I want to hide the full post and show some lines. So user an click on the read more link the the full post will be shown. plz any Idea or plugin .
my Site: http://mlmpublicnews.com/

Install the automatic read more generator. It will hide everything after the first image or first paragraph until the link is clicked.

See these with some examples. May get handy..
http://codex.wordpress.org/Customizing_the_Read_More
http://www.wikihow.com/Add-Read-More-to-Wordpress
Hope it helps..

Use the_excerpt() instead of the_content()
<?php
if ( have_posts() ) while ( have_posts() ) : the_post();
the_excerpt();
endwhile;
?>
Read More

Related

Wordpress page content variable

I am new to wordpress coding but familiar with standard HTML/CSS. With the help of various online tutorials I've finally gotten a good chunk of a simple HTML/CSS website converted to wordpress but Im missing out on some of the basics.
In this case, I am just trying to setup my template to work with the page.php file so that I can create pages through the wordpress admin console. I've figured out how to get the head.php, footer.php, and functions.php working for styles and js files but now I am struggling with what variable I need to place so that the title and content I enter into the page via the wordpress admin appears.
I've tried
1) using a div id=content to my page.php file --that didnt work
2) I've tried adding to my page.php file -- that didnt work
I cant seem to figure it out. Any help would be greatly appreciated. I am a definitley a beginner here so any help is greatly appreciated. Thanks!
This is a very basic template of a page.php in Wordpress.
<?php get_header(); ?>
<div>
<?php
if( have_posts() ) :
while ( have_posts() ) : the_post();
the_title(); // Outputs the title of the page
the_content(); // Outputs the content of the page
endwhile; // End of the loop.
endif;
?>
</div>
<?php get_footer(); ?>
Also, if you would like to store the title and content in php variables first, you can just call get_the_title() and get_the_content()
Please let me know if you are stuck.

restrict viewing photos and article content on a wordpress site

I have a question, and i hope i am posting in the right place, if this topic belongs to another forum, please guide me where to post it.
the question is: i have a website created with WordPress and i am using the Jupiter theme, i need to hide some content (like hiding the last half of the article in a page) and disable the photos to be enlarged unless the visitor is a registered user, i need to know how to do that, and if there is a plugin to do that, i have tried "layered-popups-for-wordpress" and "optin-content-locker-layered-popups-addon" but they didn't work properly.
It might request a lot of effort for you to edit the theme on your own...You can use the_excerpt() insetead of the_content() for display info, and add a rule that only registered members can see, something like
if(is_user_logged_in()) {
the_content();
} else {
the_excerpt();
}
Do this while in the loop, of course...
These plugins might help you though
https://wordpress.org/plugins/tags/paid-content
If you're using WPMU might try this one
https://premium.wpmudev.org/project/pay-per-view/
I don't know of a plugin that does this automatically, but you can do it yourself if you are willing/able to do some minor theme development. Make a child theme of your Jupiter theme, and copy over the file content.php. There will probably be some part of the code that looks like this:
<?php if ( is_search() ) : ?>
<?php the_excerpt(); ?>
<?php else : ?>
...
Or something like that. The point is, the theme should already be set up to serve excerpted content for a search. You could either simply add code like this:
<?php if ( is_search() || !is_user_logged_in() ) : ?>
<?php the_excerpt(); ?>
<?php else : ?>
...
Or you could customize what non logged in users are seeing like this:
<?php if ( is_search() ) : ?>
<?php the_excerpt(); ?>
<?php else if (!is_user_logged_in()) : ?>
<!-- Your custom code display here -->
<?php endif; ?>
Hope that's helpful!
In order to hide certain parts of your content with just a simple shortcode you may give "Restrict Anonymous Access" plugin a try:
https://wordpress.org/plugins/restrict-anonymous-access/
Examples:
[member]My restricted content …[/member]
This shortcode can be placed wherever you need to hide something from logged-out users or even users of a certain user role can be addressed:
[member role="author"]My restricted content to users below author role …[/member]

Remove post and comment box in WordPress

I'm designing a website using WordPress. I want to know how to remove the post and comment boxes which is available by default in WordPress...and also I want to know how to add plugin's in that static page
First, create page with name "Home", insert shortcode of plugin or anything you want.
Second, go to Apperance, choose Customize. At Static Front Page, tick A static page radio button, choose "Home" from dropdown list Front page. Save.
In order to remove comments yoy must select the "Screen options" in the post editor (it's an option located at top-right on the screen) and check the Comments checkbox. Then at the editor's bottom you'll find a box with a checkbox to disable comments.
If you're working in Wordpress.com you cannot add plugin's for free. This is for security reasons. You must install Worpress in your own server to do that.
Ok, as per your comments on main question, I understand you want to remove posts and comment box on public facing page, not in WP-Admin panel.
I am giving you an overview of how you can proceed.
If you are using default TwentyThirteen thee then just remove this part from single.php
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php twentythirteen_post_nav(); ?>
<?php comments_template(); ?>
<?php endwhile; ?>
This will remove post and comments template.
However I will recommend you to use custom page templates rather :
http://codex.wordpress.org/Page_Templates
Here you'll find way to add custom page templates. There you can remove posts and comments :-)

Custom Wordpress sidebar not being retrieved

I'm tuning up a website made with Wordpress and I'm facing a small inconvenient:
I want to use a custom template for the posts in a specific category, so I have a single-4.php file that gets me a custom php file for any post in cat.id 4. That works great, now for the problem...
PROBLEM -->
I want to display a custom sidebar as well, so at the end of the single-4.php I add:
<?php get_sidebar( $evento ); ?>
As instructed in the Wordpress Codex, expecting to get my sidebar-evento.php file used istead of the default sidebar.php. But it doesn't work, instead it will just use the default behaviour instead. I have also tried "'single-evento'" instead. I know that the code line is being used because if I remove it, the sidebar area breaks ( dissapears and the page breaks).
My suspicion is that the Custom Sidebars plug-in is catching up right after I call for any sidebar and regardless of which one I'm requesting, it gets replaced. But it doesn't make much sense really. Because as you can see in my sidebar-evento.php:
<div id="right">
<h3>LINE TO CHECK IF SIDEBAR-EVENTO.PHP IS SHOWN</h3>
<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
<?php endif; // end sidebar widget area ?>
<?php if ( ! dynamic_sidebar( 'sidebar-3' ) ) : ?>
<?php endif; // end sidebar widget area ?>
</div></div>
Both things should happen: A) I get my custom text, then B) I get the other custom thingies as determined by the plug-in.
I hope I've been clear about what my problem is. Please bear in mind for your response that I have no PHP knowledge, I only do HTML and this is a sort of -charity- project, so I try to learn as I go. Meaning: step-by-step might be necessary! heh. Sorry!
Thank you very much in advance.
Try:
<?php get_sidebar( 'evento' ); ?>
This should pull in sidebar-evento.php

Simple Wordpress question

I've been programming for like 5 straight hours and my brain has kinda stopped functioning.
I can't remember how to do this:
There is a page called Blog on my website, and I need to show all posts from my blog on that page. The Blog page is using custom template... Therefore, it's not index.php...
Please help me, I'm lost :/
Include loop.php in your template. That is what gets and displays posts.
To show blog post on a custom markup template, you can use this procedure, to loop if there are any posts and print them via the_content function.
<?php
if (have_posts()) :
while (have_posts()) : the_post();
the_content();
endwhile;
endif;
?>

Resources