WordPress.org

Ready to get started?Download WordPress

Forums

Update/Control the Post data that appears in search page (3 posts)

  1. startecommerce2
    Member
    Posted 1 year ago #

    How can I manage the appeared data for the post on search page.

    Currently, I have only the title and description of the post on search results, but I need the whole post data to be appeared there, exactly like how it's appear on Post Page/Homepage.

    I have tried different approaches, and suggested solutions, but with no luck

  2. KaugKo
    Member
    Posted 1 year ago #

    @startecommerce2, you need to know the WordPress Template Hierarchy. How wordpress work with page template.

    http://codex.wordpress.org/Template_Hierarchy

    I don't know whether you have search.php in your theme folder. If you have search.php the result go to that file and you have to write a post loop there and write the code to display them.

    easiest way is copy the potion of post loop from home (which you want to display) and paste them in the search.php

    If you don't know about post loop, pls read here
    http://codex.wordpress.org/The_Loop

    you can display list of template tag inside the loops.
    example: want to display post title, use "the_title()",
    want to display post content, use "the_content()",
    want to display post author, use "the_author()",
    etc..

    pls reference the post tags section of this link
    http://codex.wordpress.org/Template_Tags

    Hope this might help you :)

  3. startecommerce2
    Member
    Posted 1 year ago #

    That does not help, I have resolved that by calling the required post data on search page by editing content.php file

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.