Custom post formats

Posted in: Newspaper
Post count: 16

Is it possible to add more to these format options?
Or remove the ones in the theme, so i can make my own instead?

post formats

  • This topic was modified 11 years by momo.
Post count: 7909

Hi,

The formats are defined in td_config.phphttp://screencast.com/t/8O4PV29W you can find more information here – http://www.tinymce.com/wiki.php/Configuration:style_formats if you want to add new style formats.

Thanks!

Post count: 16

Thanks. 🙂

Is there anyway i can implement a new one in a child theme? So i dont have to make the changes after each update?

Post count: 780

Hi,

the api documentation is here https://forum.tagdiv.com/the-theme-api/ but we don’t yet have a tutorial for tiny mce.

Put your code inplace of “add the api code inside this function” – this code is a plugin


plugin_url = plugins_url('', __FILE__); // path used for elements like images, css, etc which are available on end user
        $this->plugin_path = dirname(__FILE__); // used for internal (server side) files

        add_action('td_global_after', array($this, 'hook_td_global_after')); // hook used to add or modify items via Api
    }
    function hook_td_global_after() {

//add the api code inside this function

    }
}

new td_api_plugin();
  • This reply was modified 11 years by Radu.
Post count: 8

Hi,

I have the same question as momo, but I can’t get any help from the links you’ve posted above.

I’ve found the file “td-config.php” och added some new styles to it. The styles shows correctly in the Format-menu and it ads the correct CSS to the content, but the CSS don’t affect the content that it’s applied to.

On the “the Theme API”-page you linked to above it says: “The classes are defined inside ..\[theme_name]\includes\td_wp_booster_functions.php”. Do you mean the CSS-classes or what classes?

Excuse my lack of knowledge!
Thankful for help!

I’ve added the following code:

In td_config:

// columns text
td_api_tinymce_formats::add('td_text_columns',
array(
'title' => 'Text columns'
));
td_api_tinymce_formats::add('td_text_columns_0',
array(
'parent_id' => 'td_text_columns',
'title' => 'two columns',
'block' => 'div',
'classes' => 'td_text_columns_two_cols',
'wrapper' => true,
));
td_api_tinymce_formats::add('td_text_columns_1',
array(
'parent_id' => 'td_text_columns',
'title' => 'three columns',
'block' => 'div',
'classes' => 'td_text_columns_three_cols',
'wrapper' => true,
));

In style.css:

.td_text_columns_three_cols {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
-webkit-column-gap: 40px;
-moz-column-gap: 40px;
column-gap: 40px;
-webkit-column-rule-style: solid;
-moz-column-rule-style: solid;
column-rule-style: solid;
-webkit-column-rule-width: 1px;
-moz-column-rule-width: 1px;
column-rule-width: 1px;
-webkit-column-rule-color: #e9e9e9;
-moz-column-rule-color: #e9e9e9;
column-rule-color: #e9e9e9;
margin-bottom: 26px;
}
Post count: 23312

Hello Isak Engström,

Unfortunately, this requests involve some additional customizations and imply custom work. We cannot provide this type oo services because the time does not afford us, sorry! Please consider hiring a freelancer/developer that help you in this regard, if you are not aware of the steps which are needed to take in this regard, sorry!

Thanks for the message!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.