How do we add unique content to the main content area on category pages

Discussion in 'GeoCraft WordPress Theme' started by homespunmoney, Jun 16, 2013.

  1. homespunmoney

    homespunmoney Member

    Joined:
    May 25, 2013
    Messages:
    57
    Likes Received:
    5
  2. homespunmoney

    homespunmoney Member

    Joined:
    May 25, 2013
    Messages:
    57
    Likes Received:
    5
    Hi folks.... AM very sorry to be impatient, but we ae getting ready to :launch" our site and this is one of the last action items that i don't have a solution for.

    Thanks!
    chris
     
  3. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    For this open "taxonomy-listcat.php" file and make changes as shown in the image attached.
     

    Attached Files:

  4. homespunmoney

    homespunmoney Member

    Joined:
    May 25, 2013
    Messages:
    57
    Likes Received:
    5
    Thanks Nitesh!

    That doesn't, however, quite solve my problem. I am looking for a way to place content that is unique to each category on it's specific page... in exactly the position that your remedy provides.

    Thanks in advance!
    chris
     
  5. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello Chris,

    There is single "taxonomy-listcat.php" file which is responsible for showing all categories. Unique text on specific page is not possible.
    You can only achieve it while adding text in the sidebar widget, as shown in the thread you have shared above.
     
  6. kentoliver

    kentoliver Active Member

    Joined:
    Jan 3, 2013
    Messages:
    238
    Likes Received:
    41
    Hey there,

    Not a support staff member, however the theme has some basic template files for certain pages as a lot of them are needed to generate the design / layout of the page.

    If you have a code editor I would suggest using that, or you can use the editor in the appearance part of Wordpress.

    For example:
    To do what you are asking is no way involved in the theme, so I am sure the support staff is not obligated to answer all questions for complete custom development of the GeoCraft theme. Fortunetley you are in luck that I am taking a break from my own development and can assist you.

    Nitesh is right that it is not possible through your "taxonomy-listcat.php" however, your pages are generated with a unique page ID.

    You can complete this task through conditional styling and adding some of your own divs into the header.php file.

    Lets say that you go ahead and wanted to add the text 'Hello World' to ONLY a certain page.

    You would open the header.php file and enter something like this:
    Code:
    <div class="hidden-page-stuff">
        Hello World
    </div>
    Then in your stylesheet that you have created. You style it however you like:
    Code:
    .hidden-page-stuff {
        /*MAKE SURE YOU KEEP DISPLAY */
        display:none;
        /*YOU BETTER KEEP DISPLAY */
        border-radius:10px 10px 10px 10px;
        border:1px solid #e1e1e1;
        background-color:#fff;
        padding:20px;
        font-size:36px;
        line-height:36px;
    }
    
    After you have added that to your stylesheet you have added the div to the header, and styled it correctly.
    Now we need to display it only on the page you have set up.

    Head to the page you want to display this on. Search the source code by right clicking and viewing source, or better yet, have FireBug installed and view in that.
    When you switch pages on your website you will notice that the body of your page has some classes that are unique to the page you are on.

    Some look like this: 'page-id-32' and some pages like the homepage have some that are simply 'home'.

    Once you get this concept go back to the desired page and find that specific class. For this example I am going to assume the class is 'page-id-32'.

    Then we need to go back to your custom stylesheet and add:

    Code:
    .page-id-32 .hidden-page-stuff {
        /*THIS IS TO DISPLAY INSTEAD OF HIDE */
        display:inline-block !important;
        /*YOU BETTER KEEP DISPLAY */
    }
    
    This enables the stylesheet to only display when it is under that div class.

    Voila, add the content you want instead of Hello World and you have added a div content that will only display when you are under that page-id.

    A side note, when you import and or change site locations, your page id may change.

    You can add conditional php if statements to generate class on page, however that is outside of this reply.

    Hope that helps somewhat!
    -Kent
     
    Nitesh, jsal2 and homespunmoney like this.
  7. homespunmoney

    homespunmoney Member

    Joined:
    May 25, 2013
    Messages:
    57
    Likes Received:
    5
    Wow!

    Thanks Kent!!

    This is just about the perfect level of detail for me!!!! I will let you know how I make out with these instructions..... Maybe even come back with a questions or two?

    One immediate question, though.... I'm curious about this statement "....A side note, when you import and or change site locations, your page id may change..."

    I'm wondering "import what? and change which site locations?"

    Sorry to be dense!!

    chris
     
  8. kentoliver

    kentoliver Active Member

    Joined:
    Jan 3, 2013
    Messages:
    238
    Likes Received:
    41
    Sokay Chris,

    The reason why the page-id may change is that some pages are randomly created in wordpress. And if you say went to go transfer your site these unique id numbers may change.

    For example. You set up the functionality that we were talking about. All ready to transfer it to a new server / domain. You set up a new wordpress on the new domain. For some reason you may accidentally add a page or add something which interferes or takes another ID number from your other domain which you are transferring from.

    That sounds a bit weird and complicated, so; if one domain is using an pre-existing page ID, then when importing the new page ID which is taken, is re-written to have a new ID.

    So if you are not transferring your site from domain to domain, there is no reason to worry.

    Any more questions feel free to ask.
     
    jsal2 and homespunmoney like this.
  9. homespunmoney

    homespunmoney Member

    Joined:
    May 25, 2013
    Messages:
    57
    Likes Received:
    5
    Thanks Kent! Makes perfect sense! I have this on my list to do before the weekend is over. Will let you know how it works!!!

    chris
     
  10. kentoliver

    kentoliver Active Member

    Joined:
    Jan 3, 2013
    Messages:
    238
    Likes Received:
    41
    Cool, I will check back on here frequently if you have any questions.
     
  11. homespunmoney

    homespunmoney Member

    Joined:
    May 25, 2013
    Messages:
    57
    Likes Received:
    5
    Hi Kent..... I filed a new support ticket last night....http://www.inkthemes.com/community/threads/childtheme.6348/ ... and somewhere along the way, I realized that.. that issue... is essentially the same as this one.... I think....

    I have been absorbed in other aspects of this project, so I have not yet tried your advice. I HAVE been reviewing it this morning though and was hoping you could spare another few minutes.

    1st question... does the introduction of the childtheme... add benefit to this process....?
    2nd question .... You said.....

    "........You would open the header.php file and enter something like this:
    Code:
    <div class="hidden-page-stuff">
    Hello World
    </div>
    ...... "

    When I make changes to the header.php file..... I will need to monitor future theme changes for cahnages to that file... yes? Otherwise my "downstream" edits/additions will not be visible in the upgraded site?

    .... or am I missing something?

    Thanks for helping!!
    chris
     

Share This Page