• rocke

    (@shashibhushan)


    Hi,

    I want to make a page where on each tags :
    My page should look alike : https://www.missmalini.com/aamir-khan-2/

    Above page is coming from https://www.missmalini.com/celebrity-fan-pages/

    this are categories with Tags :

    I also know that the patten is like
    Big Image is First ( First latest Post of resp. tag )… then 4 image with title are from Second post )and then only title after sixth post .. its means they have divide latest 10-12 post with this structure ,, hence how i can do same .. also if u see on top ( above Ten Latest Aamir Khan Updates ) there is “Aamir Khan Full Bio ” which is different for resp. tag.

    Hence how i can do this ( means how i can make such code ) can any one let me know.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator bcworkz

    (@bcworkz)

    You need to manage what is output by the “Loop” depending on how many posts have been output. A simple incrementing counter will do it along with a switch/case or if/elseif/else structure to do the various output styles depending on where the counter is at. For example:

    $i=1;
    while ( have_posts() ) : the_post();
    switch( $i ) {
      case 1:
        //output big image, title, excerpt
        break;
      case 2;
      case 3;
      case 4;
      case 5;
        //output thumb and title
        break;
      default:
        the_title();
    } $i++;
    endwhile;

    It’ll also take some CSS wrangling to get the various elements to display where they should. Since each display style is output from a different case, getting the CSS to apply uniquely to each display style will not be a problem.

    Thread Starter rocke

    (@shashibhushan)

    @bcworkz,

    Thanks for the reply, and bro ? about :
    ” also if u see on top ( above Ten Latest Aamir Khan Updates ) there is “Aamir Khan Full Bio ” which is different for resp. tag. “

    And :

    Photos and Videos for resp. celeb which is seen below ( scroll down ) how they are coming …

    Moderator bcworkz

    (@bcworkz)

    I’m only guessing, but my guesses could be used to similar effect even if it is not the same as is done on your example site.

    The Bio could be handled as a featured post, so it always appears at the top of the celeb’s page regardless of what the latest posts are. Some code would need to be added to the start of my example loop that checks for the presence of a featured post and handles it differently if it exists.

    I suspect the photos and videos sections are secondary queries, perhaps using get_posts(), except that only attachments with certain tags are queried. That would work for photos. Videos are different, they are not queried like any other content, all you can do is search through post content for any of the whitelisted video site URLs. Once the URLs are found, a loop using similar logic as the big picture – thumbnail logic could generate embedded content resulting in a layout just like the photos.

    Thread Starter rocke

    (@shashibhushan)

    @bcworkz,

    Dude the page https://www.missmalini.com/aamir-khan-2/ is tags of “Aamir Khan”.. hence all post that have tag “Aamir Khan ” are listed under :My page should look alike : https://www.missmalini.com/aamir-khan-2/ as

    First Latest Post : output big image, title, excerpt
    Second,Third,Fourth and Fourth Post : output thumb and title
    and Rest is : the_title();

    hence tags “Aamir Khan ” latest 10-12 posts is divide as above – which i think there have made a separate Page template for it , but i think for Photos and Videos – for tags “Aamir Khan” or for resp. tags, they have used + category ( means tags+category) to identify properly.

    And as per “Bio”, i think its Single Posts for resp. Celeb ( which carries details of celeb) and its link to resp tags. But How i am confuse in this.

    Moderator bcworkz

    (@bcworkz)

    That all may very well be, but I’m not sure that trying to replicate how the site works exactly is really necessary. You are inspired by the site and want something very much like that, that is fine. Exactly how you make your site work can be anything that works, it does not have to match what the missmalini site does as long as what you do has the same effect.

    If you can determine exactly how the site works be viewing the code used, that is one thing. Without source code, do what works for you. Whether categories or tags are used, or a custom taxonomy, it doesn’t matter much, any can be used for the same effect. Only if you have other needs for a taxonomy (for example, categories) then maybe categories will not work for you for celeb organization. You can always create a celeb_cat taxonomy to do the same function.

    Thread Starter rocke

    (@shashibhushan)

    thanks bro for gr8 idea.

    and yes the refer website have custom code of there own and i too think they are using there custom taxonomy , but after some research if u see
    https://www.missmalini.com/aamir-khan-2/ in this ” aamir-khan-2 ” might be Tag-Slug, hence they might have created a page and celeb url titlename is query with tag slug…. but i am confuse , how i can query all post url title with tags-slug

    Thread Starter rocke

    (@shashibhushan)

    How i can get Current page tags id/slug/ with some category

    Suppose i am https://www.missmalini.com/aamir-khan-2/ hence where ” aamir-khan-2 ” might be Tag-Slug,

    so i want something :
    $title = “aamir-khan-2”
    $recentPosts->query(‘cat=38&tag=$title’);

    where $title may varies as per different tags page

    Moderator bcworkz

    (@bcworkz)

    If you want to query a specific title, there is little point in adding taxonomy criteria to the query. The title alone is adequate to get the proper post. I see the example page you referenced as a taxonomy archive template, whether it is tags, categories, or taxonomy, it does not matter. It is an archive type template that contains code like I suggested previously.

    Normally, to request a taxonomy (for example “celeb_cat”) archive page, the URL looks like: “yourdomain.com/celeb_cat/celeb_term_slug/”. If you do not want the “celeb_cat/” portion of the URL, you will need a rewrite rule so the request parser knows the request term is a taxonomy slug and not a title. Then the problem arises that the rewrite rule cannot know it the request is a taxonomy term or a title. There needs to be something in the URL to distinguish titles from terms. It may be a single letter, but you need something.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Post / Page – Own Page (theme)’ is closed to new replies.