[Resolved] Link Category to a specific page – not the archive page

Home Forums Support [Resolved] Link Category to a specific page – not the archive page

Home Forums Support Link Category to a specific page – not the archive page

Viewing 12 posts - 31 through 42 (of 42 total)
  • Author
    Posts
  • #1000226
    Max

    So I added the second code your provided to the previous one.
    The complete code is:

    @media (max-width: 768px) {
        body:not(.post-image-aligned-center) .inside-article .post-image {
            margin-right: 1.5em;
            margin-left: 0;
            float: left;
            text-align: left;
            max-width: 150px;
        }
    
        .entry-summary {
            overflow: hidden;
        }
    
        .author .page-title .vcard {
            display: block;
        }
    
        .author .page-header .avatar {
            float: none;
            width: auto;
            height: auto;
        }
    }
    @media (max-width: 768px) {
        .archive .inside-article {
            display: flex;
            flex-direction: column;
        }
    
        .archive .entry-header {
            order: -1;
            margin-bottom: 1.5em;
        }
    
        body:not(.post-image-aligned-center) .inside-article .post-image {
            margin-bottom: 0;
            margin-right: 0;
            max-width: 100%;
        }
    }

    I had to adjuste the max-width: 700px value to 768px – otherwise there would have been two breakpoints one of which caused the old problem of the centered featured image. Since both of the values are the same I can just merge the code, if I am not mistaken?

    Now the only issue which remains is that the excerpt text stretches quite far across the screen after the breakpoint.
    Could I simply fix this by defining a maximum width like this:

        .entry-summary {
            overflow: hidden;
            max-width: 400px;
        }

    ?
    Or is there a better solution?

    #1000450
    Tom
    Lead Developer
    Lead Developer

    Since both of the values are the same I can just merge the code, if I am not mistaken?

    That’s correct 🙂

    That code should do it as long as it’s within the media query.

    #1002376
    Max

    Perfect – that should do the trick.

    #1002739
    Tom
    Lead Developer
    Lead Developer

    Awesome 🙂

    #1003173
    Max

    Hi again!

    I am not sure whether the original post I am replying to here is shown. It was this one (from this thread): https://generatepress.com/forums/topic/link-category-to-a-specific-page-not-the-archive-page/#post-942311

    Unfortunately a subsequent problem appeared with one of my plugins after I changed the default category pages to specific static pages showing the Post Carousel Pro plugin. I already wrote the support there but I cannot really solve the issue based on their answer and believe it is more related to WP/GP than to the plugin:

    The issue: Once you click on the menu item Posts –> All Posts I get redirected to the static page “All Posts” which displays the PCP plugin grid (it shows every post from the category “all posts”). So far everything is working correctly.
    However, once you click on the category link to “All Posts” (the category that is displayed under every post, e.g. on the homepage or archive pages) you will get redirected to that page again but basically the pagination stops working, meaning, you cannot go to “page 2” even if you click on the button at the bottom of the page.

    The answer from the support team was:

    The first link is showing all the posts from the category page. Our carousel is not from the category page. That’s why the pagination is not working. 🙂
    If you want to paginate posts from the category page then you have to do it from the category page template of the theme you are using. There is no relation between the category page template and the plugin.

    If you go through the ‘https://alexandrin.de/all-posts/‘ from the menu of your website then the pagination will work definitely. Because this grid is coming from the ‘all posts’ page directly. You have used the shortcode of the grid in the ‘All Posts’ page. That’s why the pagination will work on this page. I’ve checked the pagination functionality and found it’s working nicely.

    And sure, I see the difference:

    The first link (via a category button) goes: https://alexandrin.de/category/all-posts/
    The second (via the menu): https://alexandrin.de/all-posts/

    Unfortunately I have no idea how to solve this/how to edit the category page template so that the plugin might work. At the moment the original solution is basically rendered useless because the plugin cannot display the posts correctly. Although I do not quite understand why it is displaying posts at all.

    Any help would be much appreciated.

    #1003382
    Tom
    Lead Developer
    Lead Developer

    I’m not sure I fully understand. Would 301 redirecting the category/all-posts to the all-posts page be a solution?

    Let me know 🙂

    #1003438
    Max

    I am not sure what 301 means? : )

    Hm we could give that a shot. So basically, once you click on one of the three categories availabe on my website the user should be redirected to the static page immediately and not to the according category page.

    So not to: https://alexandrin.de/category/static page
    but to: https://alexandrin.de/static page

    Originally I created this thread (here in the forum) because I wanted to have individual category pages and not the ones which get generated automatically by WP. This probably creates some kind of conflict with the plugin.

    #1003628
    Tom
    Lead Developer
    Lead Developer

    This plugin might help set those redirects up: https://wordpress.org/plugins/simple-301-redirects/

    #1003804
    Max

    Hi Tom!

    I installed the plugin and redirected https://alexandrin.de/category/all-posts/ to https://alexandrin.de/all-posts/ – unfortunately that did not show any effect. Once I click on the category “all posts” in the carousel on the homepage I will still get redirected to https://alexandrin.de/category/all-posts/ which basically keeps the plugin (PCP) from functioning. In the reviews I also read that the 301 plugin seems to have had some issues lately.

    #1004140
    Tom
    Lead Developer
    Lead Developer

    There are others to try: https://wordpress.org/plugins/eps-301-redirects/

    You can also do redirects on the server-level if you check with your hosting.

    #1004605
    Max

    And that one actually did the trick!

    As a hint for other users: I noticed that the issue probably only appears in one category (all posts) whereas the other ones directly link to the specified static page which I created. I believe this is because “all posts” is a parent category – the others are not. So apparently parent categories are not targeted by the snippet I am using (see previous posts).

    Thanks a lot for the help!

    #1004945
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

Viewing 12 posts - 31 through 42 (of 42 total)
  • You must be logged in to reply to this topic.