Forums

how i can use <?php the_content(__('(more...)')); ?> (6 posts)

  1. Anonymous
    Unregistered
    Posted 3 years ago #

    i want to use this tag in one page and i dont want to have <p> and </P> in my page after use this code
    how i can use this tag and dont start my post with <p> and finish with </p>

  2. chaoskaizer
    Member
    Posted 3 years ago #

    add this inside functions.php

    function remove_wpautop_content_filter() {
    	remove_filter('the_content','wpautop');
    }

    for specific page add the below code before the loop start (above if has_post conditional) inside your page.php or index.php template (if you dont have page.php)

    <?php
    $my_pagename = 'about';
    if ( is_page() == $my_pagename ) {
    	add_action('loop_start','remove_wpautop_content_filter');
    }
    ?>
  3. Anonymous
    Unregistered
    Posted 3 years ago #

    i do what you said but it doesent work
    my page code

    <?php
    get_header();
    ?>
    <?php
    $my_pagename = 'about';
    if ( is_page() == $my_pagename ) {
    	add_action('loop_start','remove_wpautoop_content_filter');
    }
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	<a href="<?php the_content(__('(more...)')); ?>"><?php the_title(); ?></a>
    
    </div>
    
    <?php comments_template(); // Get wp-comments.php template ?>
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    
    <?php posts_nav_link(' — ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?>
    
    <?php get_footer(); ?>

    my page link ( go on the link with mouse and see the path of link
    http://www.funfarsi.com/en/wordpress/

  4. chaoskaizer
    Member
    Posted 3 years ago #

    i see ur error msg

    rWarning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'remove_wpautoop_content_filter' was given in /../en/wordpress/wp-includes/plugin.php on line 311

    its a syntax error (typo)

    change

    add_action('loop_start','remove_wpautoop_content_filter');

    to

    add_action('loop_start','remove_wpautop_content_filter');
  5. Anonymous
    Unregistered
    Posted 3 years ago #

    dont work this too

  6. chaoskaizer
    Member
    Posted 3 years ago #

    something is wrong with your wordpress Im seeing random error.
    everything is garbled

    <a href="This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.">About</a>
    
    </div>
    
    <iframe name="I1"  src="This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress."
    height="300%" width="99%" border="0" frameborder="0" style="width: 100%; background-color:#FFFFFF" marginwidth="13" marginheight="13">
    Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.