ThemeShaper Forums » Thematic

[closed]

Widget Index Insert Position - where change the value after x posts

(5 posts)
  • Started 12 years ago by ChrisR
  • Latest reply from ChrisR
  • This topic is not resolved
  1. ChrisR
    Member

    Hello! Please I need help to find the code to change to following:
    Widget Index Insert - The widget area inserted after x posts on the index page.
    I like to change the pre-setting x= after 2 posts to another value.

    I have Thematic 0.9.7.7 and (as a non PHP-coder, maybe "Hacker") searched down and up to find pieces of the generating code. I think it is the variable "thm_insert_position", but I found only one place, where it is used and no place where it is defined. Here is what i found:

    content-extensions.php
    if ($count==$thm_insert_position) {
    get_sidebar('index-insert');
    }
    $count = $count + 1;
    endwhile;
    }
    } // end index_loop

    sidebar-index-insert.php
    // action hook creating the 'index-insert' widget area
    widget_area_index_insert();

    widgets-extensions.php
    'Index Insert' => array(
    'admin_menu_order' => 700,
    'args' => array (
    'name' => 'Index Insert',
    'id' => 'index-insert',
    'description' => __('The widget area inserted after x posts on the index page.', 'thematic'),
    'before_widget' => thematic_before_widget(),
    'after_widget' => thematic_after_widget(),
    'before_title' => thematic_before_title(),
    'after_title' => thematic_after_title(),
    ),
    'action_hook' => 'widget_area_index_insert',
    'function' => 'thematic_index_insert',
    'priority' => 10,
    ),

    // Define the Index Insert
    function thematic_index_insert() {
    if (is_active_sidebar('index-insert')) {
    echo thematic_before_widget_area('index-insert');
    dynamic_sidebar('index-insert');
    echo thematic_after_widget_area('index-insert');
    }
    }

    sidebar-extensions.php
    // ocated in sidebar-index-insert.php
    function widget_area_index_insert() {
    do_action('widget_area_index_insert');
    } // end widget_area_index_insert

    Posted 12 years ago #
  2. You'll find it under Thematic Options on your WordPress Panel(under appearance)

    Posted 12 years ago #
  3. ChrisR
    Member

    Thank you for your answer! I'm using also Thematic Options 2.2 and this Theme Child hides the "Thematic Options". I will digg deeper in the functions, but realize that Thematic is maybe to complex to customize for my PHP-Knowledge.

    Posted 12 years ago #
  4. are you using devin's Options theme? or mine? either way there will be a section somewhere that removes the Options panel. it will look 'similar' to this (note especially the remove_action from admin_menu)

    function remove_thematic_panel() {
      remove_action('admin_menu' , 'mytheme_add_admin');
    }
    add_action('init', 'remove_thematic_panel');

    comment that out or delete it and the thematic panel will come back.

    you could also copy the thematic_index_loop function into your child's functions.php, rename it to childtheme_override_index_loop and hard-code this value manually.

    if ($count==$thm_insert_position) {
        get_sidebar('index-insert');
    }

    by changing $thm_insert_position to an actual number

    Posted 12 years ago #
  5. ChrisR
    Member

    Thanks Helga. I got that. I don't remind where I DL the Options Theme some month ago, the readme.txt points to http://wptheming.com/thematic-options-panel - so I thinks its Devin's...

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.