• Resolved TravelingSam

    (@travelingsam)


    Hi!

    I realize that my title is very confusing but I’ll try to explain it simple and easy.

    So in the future I hope to update my blog with reviews from travels and adventures from all over the world. To keep track of everything I would therefore like to sort all the posts in to different pages depending on which country they are from. For example a post reviewing a trip to “Uluru” should go to the page “Australia”.

    So far so good?

    Since there are still very many countries I would like to take it one step further and sort all the country pages into continent pages. For example “Uluru” should go into the page “Australia” which should go into “Oceania”.

    In the end I want the webpage to look roughly like it does now but when you click on the continents a list of countries should appear instead of a list of posts from the continent in whole.

    https://www.travelingsam.com/

    This is the webpage and as it is now I have created a category for each continent and simply written ([add_posts category=CONTINENT NAME=10]) on the “continent” page.

    I appreciate any help to get me going in the right direction!

    Thank you
    //TravelingSam

Viewing 15 replies - 1 through 15 (of 15 total)
  • Johnathan

    (@jelyman)

    Sounds like nested or parent-child categories might be what you’re looking for and displaying categories belonging to larger categories might the ticket.

    You might find an example that’ll work for you on this thread:
    https://www.ads-software.com/support/topic/list-child-categories-of-current-category-page?replies=6

    You can use these functions, perhaps, to get started:

    <?php $this_cat = (get_query_var('cat')) ? get_query_var('cat') : 1; ?>
    <?php wp_list_categories('child_of=' . $this_cat . ''); ?>
    Thread Starter TravelingSam

    (@travelingsam)

    The blog referred to in the other thread does not seem to work…

    I’m a real beginner at this so unfortunately I don’t really I understand that code. I would appreciate some kind of simple guide if that is possible?

    Sorry for all the inconvenience :/

    Thread Starter TravelingSam

    (@travelingsam)

    I’ve been looking at the problem for a few hours and found that the child-parent category system worked just fine. Thanks for that!

    However I wonder if it is somehow possible to make the “clickdownbox” smaller? If you enter the blog https://www.travelingsam.com/ and hold the marker on Europe the box just continues going downwards. Right now it’s looking just fine but in the future I’m guessing it will just continue all the way down. There is lots of space between the different countries so it looks like it is possible?

    To clarify I want to change it from being…

    Europe ^

    Croatia

    Czech Republic

    England…

    to

    Europe ^
    Croatia
    Czech Republic
    England…

    Thanks for any and all help!

    Johnathan

    (@jelyman)

    I’m writing this off the cuff and haven’t really tested it but looking at the CSS I would expect adding these lines as custom CSS would shrink the gap down:

    li.menu-item a {
    margin-top: 5px;
    margin-bottom: 5px;
    }

    That would take it from its current 18px down to 5px on top and bottom.

    Thread Starter TravelingSam

    (@travelingsam)

    Where am I supposed to write this? I’ve opened the editor and see all the CSS but I’m really new to this so I don’t really know where to paste it.

    Thank you for the help!
    I really appreciate it!
    //Cheers

    Johnathan

    (@jelyman)

    If you have Custom CSS turned on via JetPack, that’d be the best place to put it. Whatever is inserted there overrides theme CSS files. Otherwise, your style.css file in your theme at the bottom, including !important like so:

    li.menu-item a {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    }
    Thread Starter TravelingSam

    (@travelingsam)

    So I downloaded the jetpack plugin and went to CSS Stylesheet Editor and added the first code like this…

    1. li.menu-item a {
    2. margin-top: 5px;
    3. margin-bottom: 5px;
    4. }

    Unfortunately it did not help. The paces are still as large :/

    Did I do anything wrong?

    Johnathan

    (@jelyman)

    I did some more poking and tweaking, and think this might work better…

    In style.css look for this line:

    .primary-navigation ul ul a

    It’s about 3800 lines in so don’t hesitate to just search for it.

    There’s a commented out line within it that looks like this:

    /* padding: 18px 12px; */

    Remove the comment brackets /* and */ and adjust the first number 18px up or down as you like. This number adjusts the padding size above and below the text simultaneously.

    My test on the fly seemed to work well in Chrome (screenshot)

    Let me know if that helps.

    Thread Starter TravelingSam

    (@travelingsam)

    I tried this but there were no results… However there were no brackets (/* and */) from the beginning. Could this have been a problem?. I found the place you explained and I changed the 18 pxl but it did not show on the page. Everything was done in both chrome and explorer.

    What am I doing wrong?

    PS/ I really appreciate the help! You are very good at explaining what I should do. ??

    //TavelingSam

    Johnathan

    (@jelyman)

    Hard to say, when what I update works for me (albeit just in my browser at that moment). The comment brackets might have been a product from Chrome and its code inspector. I did just look at your theme’s style.css file and I don’t see the changes made. Are you sure you’re editing the style.css file under Appearance > Editor and choosing “Stylesheet” (styles.css).

    Thread Starter TravelingSam

    (@travelingsam)

    Apperance > Editor > twenty fourteen > style.css is where I’ve changed it from 18 to 4. Does this not appear on your computer? Could it be a problem that i have a child theme connected to 2014?

    Johnathan

    (@jelyman)

    The child theme will piggyback off of the original but not override anything it’s not explicitly configured to override.

    I refreshed your site and am seeing the changes.

    It wouldn’t hurt to clear your browser cache and if you have any caching plugins, clear their caches, too.

    Thread Starter TravelingSam

    (@travelingsam)

    I’ve restarted the computer and emptied all caches but still I can not see the change on chrome or explorer. I can however see them on Mozila. What else can I do to see the changes?

    Cheers

    Johnathan

    (@jelyman)

    At this point, I’m not entirely sure.

    I just fired up your site in another browser that I hadn’t previously been using for this and it looks as it should.

    For sanity’s sake, you can clear Chrome’s cache by choosing the Menu icon in the top right corner, choosing Settings, clicking Show Advanced Settings at the bottom of the page, and clicking the Clear Browsing Data button.

    Thread Starter TravelingSam

    (@travelingsam)

    A good night sleep made the trick. When I fired it up this morning I could see the changes.

    Thank you very much for all the help!

    I don’t know how I can thank you enough ??

    Cheers
    //Adam

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Is it possible to sort posts in different pages within different pages?’ is closed to new replies.